Makefile 1.0 KB
Newer Older
M
Matthew Wilcox 已提交
1

2
CFLAGS += -I. -I../../include -g -O2 -Wall -D_LGPL_SOURCE -fsanitize=address
M
Matthew Wilcox 已提交
3
LDFLAGS += -lpthread -lurcu
4 5 6 7
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
8 9 10 11

ifdef BENCHMARK
	CFLAGS += -DBENCHMARK=1
endif
M
Matthew Wilcox 已提交
12 13 14 15

targets: $(TARGETS)

main:	$(OFILES)
16 17 18 19 20 21 22
	$(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
M
Matthew Wilcox 已提交
23 24

clean:
25
	$(RM) $(TARGETS) *.o radix-tree.c idr.c
M
Matthew Wilcox 已提交
26

27
vpath %.c ../../lib
28 29 30

$(OFILES): *.h */*.h \
	../../include/linux/*.h \
31
	../../include/asm/*.h \
32 33
	../../../include/linux/radix-tree.h \
	../../../include/linux/idr.h
M
Matthew Wilcox 已提交
34 35 36

radix-tree.c: ../../../lib/radix-tree.c
	sed -e 's/^static //' -e 's/__always_inline //' -e 's/inline //' < $< > $@
37 38 39

idr.c: ../../../lib/idr.c
	sed -e 's/^static //' -e 's/__always_inline //' -e 's/inline //' < $< > $@