xref: /linux-6.15/tools/testing/radix-tree/Makefile (revision c4634b08)
  • Home
  • History
  • Annotate
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1
2CFLAGS += -I. -I../../include -g -O2 -Wall -D_LGPL_SOURCE -fsanitize=address
3LDFLAGS += -lpthread -lurcu
4TARGETS = main idr-test multiorder
5CORE_OFILES := radix-tree.o idr.o linux.o test.o find_bit.o
6OFILES = 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
9ifndef SHIFT
10	SHIFT=3
11endif
12
13ifeq ($(BUILD), 32)
14	CFLAGS += -m32
15endif
16
17targets: mapshift $(TARGETS)
18
19main:	$(OFILES)
20	$(CC) $(CFLAGS) $(LDFLAGS) $^ -o main
21
22idr-test: idr-test.o $(CORE_OFILES)
23	$(CC) $(CFLAGS) $(LDFLAGS) $^ -o idr-test
24
25multiorder: multiorder.o $(CORE_OFILES)
26	$(CC) $(CFLAGS) $(LDFLAGS) $^ -o multiorder
27
28clean:
29	$(RM) $(TARGETS) *.o radix-tree.c idr.c generated/map-shift.h
30
31vpath %.c ../../lib
32
33$(OFILES): *.h */*.h generated/map-shift.h \
34	../../include/linux/*.h \
35	../../include/asm/*.h \
36	../../../include/linux/radix-tree.h \
37	../../../include/linux/idr.h
38
39radix-tree.c: ../../../lib/radix-tree.c
40	sed -e 's/^static //' -e 's/__always_inline //' -e 's/inline //' < $< > $@
41
42idr.c: ../../../lib/idr.c
43	sed -e 's/^static //' -e 's/__always_inline //' -e 's/inline //' < $< > $@
44
45.PHONY: mapshift
46
47mapshift:
48	@if ! grep -qw $(SHIFT) generated/map-shift.h; then		\
49		echo "#define RADIX_TREE_MAP_SHIFT $(SHIFT)" >		\
50				generated/map-shift.h;			\
51	fi
52

served by {OpenGrok

Last Index Update: Fri May 15 20:09:11 GMT 2026