Makefile 1.2 KB

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