2017-11-01 15:07:57 +01:00
|
|
|
# SPDX-License-Identifier: GPL-2.0
|
2016-03-17 14:21:45 -07:00
|
|
|
|
2018-05-19 16:30:54 -04:00
|
|
|
CFLAGS += -I. -I../../include -g -Og -Wall -D_LGPL_SOURCE -fsanitize=address \
|
|
|
|
|
-fsanitize=undefined
|
|
|
|
|
LDFLAGS += -fsanitize=address -fsanitize=undefined
|
2017-03-02 04:29:00 -05:00
|
|
|
LDLIBS+= -lpthread -lurcu
|
2017-11-07 14:57:46 -05:00
|
|
|
TARGETS = main idr-test multiorder xarray
|
2017-11-10 15:15:08 -05:00
|
|
|
CORE_OFILES := xarray.o radix-tree.o idr.o linux.o test.o find_bit.o bitmap.o
|
2016-12-18 22:56:05 -05:00
|
|
|
OFILES = main.o $(CORE_OFILES) regression1.o regression2.o regression3.o \
|
2018-12-06 08:19:13 -05:00
|
|
|
regression4.o \
|
2016-12-18 22:56:05 -05:00
|
|
|
tag_check.o multiorder.o idr-test.o iteration_check.o benchmark.o
|
2016-12-14 15:08:14 -08:00
|
|
|
|
2017-02-13 16:16:03 -05:00
|
|
|
ifndef SHIFT
|
|
|
|
|
SHIFT=3
|
2016-12-14 15:08:14 -08:00
|
|
|
endif
|
2016-03-17 14:21:45 -07:00
|
|
|
|
2017-02-27 08:49:00 -05:00
|
|
|
ifeq ($(BUILD), 32)
|
|
|
|
|
CFLAGS += -m32
|
2017-03-03 12:28:37 -05:00
|
|
|
LDFLAGS += -m32
|
2017-02-27 08:49:00 -05:00
|
|
|
endif
|
|
|
|
|
|
2018-05-18 16:08:51 -07:00
|
|
|
targets: generated/map-shift.h $(TARGETS)
|
2016-03-17 14:21:45 -07:00
|
|
|
|
|
|
|
|
main: $(OFILES)
|
2016-12-18 22:56:05 -05:00
|
|
|
|
2018-06-18 16:59:29 -04:00
|
|
|
idr-test.o: ../../../lib/test_ida.c
|
2016-12-18 22:56:05 -05:00
|
|
|
idr-test: idr-test.o $(CORE_OFILES)
|
|
|
|
|
|
2017-11-07 14:57:46 -05:00
|
|
|
xarray: $(CORE_OFILES)
|
|
|
|
|
|
2016-12-18 22:56:05 -05:00
|
|
|
multiorder: multiorder.o $(CORE_OFILES)
|
2016-03-17 14:21:45 -07:00
|
|
|
|
|
|
|
|
clean:
|
2017-02-13 16:16:03 -05:00
|
|
|
$(RM) $(TARGETS) *.o radix-tree.c idr.c generated/map-shift.h
|
2016-03-17 14:21:45 -07:00
|
|
|
|
2016-12-28 22:53:46 -05:00
|
|
|
vpath %.c ../../lib
|
2016-12-14 15:08:29 -08:00
|
|
|
|
2017-03-02 12:24:28 -05:00
|
|
|
$(OFILES): Makefile *.h */*.h generated/map-shift.h \
|
2016-12-14 15:08:29 -08:00
|
|
|
../../include/linux/*.h \
|
2016-12-19 11:09:34 -05:00
|
|
|
../../include/asm/*.h \
|
2017-11-07 16:30:10 -05:00
|
|
|
../../../include/linux/xarray.h \
|
2016-12-20 10:27:56 -05:00
|
|
|
../../../include/linux/radix-tree.h \
|
|
|
|
|
../../../include/linux/idr.h
|
2016-03-17 14:21:45 -07:00
|
|
|
|
|
|
|
|
radix-tree.c: ../../../lib/radix-tree.c
|
|
|
|
|
sed -e 's/^static //' -e 's/__always_inline //' -e 's/inline //' < $< > $@
|
2016-12-20 10:27:56 -05:00
|
|
|
|
|
|
|
|
idr.c: ../../../lib/idr.c
|
|
|
|
|
sed -e 's/^static //' -e 's/__always_inline //' -e 's/inline //' < $< > $@
|
2017-02-13 16:16:03 -05:00
|
|
|
|
2017-11-07 14:57:46 -05:00
|
|
|
xarray.o: ../../../lib/xarray.c ../../../lib/test_xarray.c
|
2017-11-07 16:30:10 -05:00
|
|
|
|
2018-05-18 16:08:51 -07:00
|
|
|
generated/map-shift.h:
|
2017-03-02 12:24:28 -05:00
|
|
|
@if ! grep -qws $(SHIFT) generated/map-shift.h; then \
|
2017-11-03 23:09:45 -04:00
|
|
|
echo "#define XA_CHUNK_SHIFT $(SHIFT)" > \
|
2017-02-13 16:16:03 -05:00
|
|
|
generated/map-shift.h; \
|
|
|
|
|
fi
|