Matthew Wilcox | 1366c37 | 2016-03-17 14:21:45 -0700 | [diff] [blame] | 1 | |
Matthew Wilcox | 829f83d | 2017-01-28 10:03:48 -0500 | [diff] [blame] | 2 | CFLAGS += -I. -I../../include -g -O2 -Wall -D_LGPL_SOURCE -fsanitize=address |
Matthew Wilcox | 1366c37 | 2016-03-17 14:21:45 -0700 | [diff] [blame] | 3 | LDFLAGS += -lpthread -lurcu |
Matthew Wilcox | 8ac0486 | 2016-12-18 22:56:05 -0500 | [diff] [blame] | 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 |
Konstantin Khlebnikov | cfa40bc | 2016-12-14 15:08:14 -0800 | [diff] [blame] | 8 | |
Rehas Sachdeva | c6ce3e2f | 2017-02-13 16:16:03 -0500 | [diff] [blame] | 9 | ifndef SHIFT |
| 10 | SHIFT=3 |
Konstantin Khlebnikov | cfa40bc | 2016-12-14 15:08:14 -0800 | [diff] [blame] | 11 | endif |
Matthew Wilcox | 1366c37 | 2016-03-17 14:21:45 -0700 | [diff] [blame] | 12 | |
Rehas Sachdeva | c6ce3e2f | 2017-02-13 16:16:03 -0500 | [diff] [blame] | 13 | targets: mapshift $(TARGETS) |
Matthew Wilcox | 1366c37 | 2016-03-17 14:21:45 -0700 | [diff] [blame] | 14 | |
| 15 | main: $(OFILES) |
Matthew Wilcox | 8ac0486 | 2016-12-18 22:56:05 -0500 | [diff] [blame] | 16 | $(CC) $(CFLAGS) $(LDFLAGS) $^ -o main |
| 17 | |
| 18 | idr-test: idr-test.o $(CORE_OFILES) |
| 19 | $(CC) $(CFLAGS) $(LDFLAGS) $^ -o idr-test |
| 20 | |
| 21 | multiorder: multiorder.o $(CORE_OFILES) |
| 22 | $(CC) $(CFLAGS) $(LDFLAGS) $^ -o multiorder |
Matthew Wilcox | 1366c37 | 2016-03-17 14:21:45 -0700 | [diff] [blame] | 23 | |
| 24 | clean: |
Rehas Sachdeva | c6ce3e2f | 2017-02-13 16:16:03 -0500 | [diff] [blame] | 25 | $(RM) $(TARGETS) *.o radix-tree.c idr.c generated/map-shift.h |
Matthew Wilcox | 1366c37 | 2016-03-17 14:21:45 -0700 | [diff] [blame] | 26 | |
Matthew Wilcox | 991af73 | 2016-12-28 22:53:46 -0500 | [diff] [blame] | 27 | vpath %.c ../../lib |
Matthew Wilcox | 0629573 | 2016-12-14 15:08:29 -0800 | [diff] [blame] | 28 | |
Rehas Sachdeva | c6ce3e2f | 2017-02-13 16:16:03 -0500 | [diff] [blame] | 29 | $(OFILES): *.h */*.h generated/map-shift.h \ |
Matthew Wilcox | 0629573 | 2016-12-14 15:08:29 -0800 | [diff] [blame] | 30 | ../../include/linux/*.h \ |
Matthew Wilcox | 43a30c2 | 2016-12-19 11:09:34 -0500 | [diff] [blame] | 31 | ../../include/asm/*.h \ |
Matthew Wilcox | 0a835c4 | 2016-12-20 10:27:56 -0500 | [diff] [blame] | 32 | ../../../include/linux/radix-tree.h \ |
| 33 | ../../../include/linux/idr.h |
Matthew Wilcox | 1366c37 | 2016-03-17 14:21:45 -0700 | [diff] [blame] | 34 | |
| 35 | radix-tree.c: ../../../lib/radix-tree.c |
| 36 | sed -e 's/^static //' -e 's/__always_inline //' -e 's/inline //' < $< > $@ |
Matthew Wilcox | 0a835c4 | 2016-12-20 10:27:56 -0500 | [diff] [blame] | 37 | |
| 38 | idr.c: ../../../lib/idr.c |
| 39 | sed -e 's/^static //' -e 's/__always_inline //' -e 's/inline //' < $< > $@ |
Rehas Sachdeva | c6ce3e2f | 2017-02-13 16:16:03 -0500 | [diff] [blame] | 40 | |
| 41 | .PHONY: mapshift |
| 42 | |
| 43 | mapshift: |
| 44 | @if ! grep -qw $(SHIFT) generated/map-shift.h; then \ |
| 45 | echo "#define RADIX_TREE_MAP_SHIFT $(SHIFT)" > \ |
| 46 | generated/map-shift.h; \ |
| 47 | fi |