Tvrtko Ursulin | c963624 | 2017-09-06 15:55:06 +0100 | [diff] [blame] | 1 | CFLAGS += -I. -I../../include -g -O2 -Wall -fsanitize=address |
| 2 | LDFLAGS += -fsanitize=address -fsanitize=undefined |
| 3 | TARGETS = main |
| 4 | OFILES = main.o scatterlist.o |
| 5 | |
| 6 | ifeq ($(BUILD), 32) |
| 7 | CFLAGS += -m32 |
| 8 | LDFLAGS += -m32 |
| 9 | endif |
| 10 | |
| 11 | targets: include $(TARGETS) |
| 12 | |
| 13 | main: $(OFILES) |
| 14 | |
| 15 | clean: |
| 16 | $(RM) $(TARGETS) $(OFILES) scatterlist.c linux/scatterlist.h linux/highmem.h linux/kmemleak.h asm/io.h |
| 17 | @rmdir asm |
| 18 | |
| 19 | scatterlist.c: ../../../lib/scatterlist.c |
| 20 | @sed -e 's/^static //' -e 's/__always_inline //' -e 's/inline //' < $< > $@ |
| 21 | |
| 22 | .PHONY: include |
| 23 | |
| 24 | include: ../../../include/linux/scatterlist.h |
| 25 | @mkdir -p linux |
| 26 | @mkdir -p asm |
| 27 | @touch asm/io.h |
| 28 | @touch linux/highmem.h |
| 29 | @touch linux/kmemleak.h |
| 30 | @cp $< linux/scatterlist.h |