Makefile 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. # SPDX-License-Identifier: GPL-2.0
  2. CFLAGS += -I. -I../../include -g -Og -Wall -D_LGPL_SOURCE -fsanitize=address \
  3. -fsanitize=undefined
  4. LDFLAGS += -fsanitize=address -fsanitize=undefined
  5. LDLIBS+= -lpthread -lurcu
  6. TARGETS = main idr-test multiorder
  7. CORE_OFILES := radix-tree.o idr.o linux.o test.o find_bit.o
  8. OFILES = main.o $(CORE_OFILES) regression1.o regression2.o regression3.o \
  9. tag_check.o multiorder.o idr-test.o iteration_check.o benchmark.o
  10. ifndef SHIFT
  11. SHIFT=3
  12. endif
  13. ifeq ($(BUILD), 32)
  14. CFLAGS += -m32
  15. LDFLAGS += -m32
  16. endif
  17. targets: generated/map-shift.h $(TARGETS)
  18. main: $(OFILES)
  19. idr-test.o: ../../../lib/test_ida.c
  20. idr-test: idr-test.o $(CORE_OFILES)
  21. multiorder: multiorder.o $(CORE_OFILES)
  22. clean:
  23. $(RM) $(TARGETS) *.o radix-tree.c idr.c generated/map-shift.h
  24. vpath %.c ../../lib
  25. $(OFILES): Makefile *.h */*.h generated/map-shift.h \
  26. ../../include/linux/*.h \
  27. ../../include/asm/*.h \
  28. ../../../include/linux/radix-tree.h \
  29. ../../../include/linux/idr.h
  30. radix-tree.c: ../../../lib/radix-tree.c
  31. sed -e 's/^static //' -e 's/__always_inline //' -e 's/inline //' < $< > $@
  32. idr.c: ../../../lib/idr.c
  33. sed -e 's/^static //' -e 's/__always_inline //' -e 's/inline //' < $< > $@
  34. generated/map-shift.h:
  35. @if ! grep -qws $(SHIFT) generated/map-shift.h; then \
  36. echo "#define RADIX_TREE_MAP_SHIFT $(SHIFT)" > \
  37. generated/map-shift.h; \
  38. fi