2016-03-18 05:21:45 +08:00
|
|
|
|
2017-01-28 23:03:48 +08:00
|
|
|
CFLAGS += -I. -I../../include -g -O2 -Wall -D_LGPL_SOURCE -fsanitize=address
|
2016-03-18 05:21:45 +08:00
|
|
|
LDFLAGS += -lpthread -lurcu
|
2016-12-19 11:56:05 +08:00
|
|
|
TARGETS = main idr-test multiorder
|
|
|
|
CORE_OFILES := radix-tree.o idr.o linux.o test.o find_bit.o
|
|
|
|
OFILES = main.o $(CORE_OFILES) regression1.o regression2.o regression3.o \
|
|
|
|
tag_check.o multiorder.o idr-test.o iteration_check.o benchmark.o
|
2016-12-15 07:08:14 +08:00
|
|
|
|
2017-02-14 05:16:03 +08:00
|
|
|
ifndef SHIFT
|
|
|
|
SHIFT=3
|
2016-12-15 07:08:14 +08:00
|
|
|
endif
|
2016-03-18 05:21:45 +08:00
|
|
|
|
2017-02-27 21:49:00 +08:00
|
|
|
ifeq ($(BUILD), 32)
|
|
|
|
CFLAGS += -m32
|
|
|
|
endif
|
|
|
|
|
2017-02-14 05:16:03 +08:00
|
|
|
targets: mapshift $(TARGETS)
|
2016-03-18 05:21:45 +08:00
|
|
|
|
|
|
|
main: $(OFILES)
|
2016-12-19 11:56:05 +08:00
|
|
|
$(CC) $(CFLAGS) $(LDFLAGS) $^ -o main
|
|
|
|
|
|
|
|
idr-test: idr-test.o $(CORE_OFILES)
|
|
|
|
$(CC) $(CFLAGS) $(LDFLAGS) $^ -o idr-test
|
|
|
|
|
|
|
|
multiorder: multiorder.o $(CORE_OFILES)
|
|
|
|
$(CC) $(CFLAGS) $(LDFLAGS) $^ -o multiorder
|
2016-03-18 05:21:45 +08:00
|
|
|
|
|
|
|
clean:
|
2017-02-14 05:16:03 +08:00
|
|
|
$(RM) $(TARGETS) *.o radix-tree.c idr.c generated/map-shift.h
|
2016-03-18 05:21:45 +08:00
|
|
|
|
2016-12-29 11:53:46 +08:00
|
|
|
vpath %.c ../../lib
|
2016-12-15 07:08:29 +08:00
|
|
|
|
2017-02-14 05:16:03 +08:00
|
|
|
$(OFILES): *.h */*.h generated/map-shift.h \
|
2016-12-15 07:08:29 +08:00
|
|
|
../../include/linux/*.h \
|
2016-12-20 00:09:34 +08:00
|
|
|
../../include/asm/*.h \
|
2016-12-20 23:27:56 +08:00
|
|
|
../../../include/linux/radix-tree.h \
|
|
|
|
../../../include/linux/idr.h
|
2016-03-18 05:21:45 +08:00
|
|
|
|
|
|
|
radix-tree.c: ../../../lib/radix-tree.c
|
|
|
|
sed -e 's/^static //' -e 's/__always_inline //' -e 's/inline //' < $< > $@
|
2016-12-20 23:27:56 +08:00
|
|
|
|
|
|
|
idr.c: ../../../lib/idr.c
|
|
|
|
sed -e 's/^static //' -e 's/__always_inline //' -e 's/inline //' < $< > $@
|
2017-02-14 05:16:03 +08:00
|
|
|
|
|
|
|
.PHONY: mapshift
|
|
|
|
|
|
|
|
mapshift:
|
|
|
|
@if ! grep -qw $(SHIFT) generated/map-shift.h; then \
|
|
|
|
echo "#define RADIX_TREE_MAP_SHIFT $(SHIFT)" > \
|
|
|
|
generated/map-shift.h; \
|
|
|
|
fi
|