1c9636244STvrtko UrsulinCFLAGS += -I. -I../../include -g -O2 -Wall -fsanitize=address
2c9636244STvrtko UrsulinLDFLAGS += -fsanitize=address -fsanitize=undefined
3c9636244STvrtko UrsulinTARGETS = main
4c9636244STvrtko UrsulinOFILES = main.o scatterlist.o
5c9636244STvrtko Ursulin
6c9636244STvrtko Ursulinifeq ($(BUILD), 32)
7c9636244STvrtko Ursulin        CFLAGS += -m32
8c9636244STvrtko Ursulin        LDFLAGS += -m32
9c9636244STvrtko Ursulinendif
10c9636244STvrtko Ursulin
11c9636244STvrtko Ursulintargets: include $(TARGETS)
12c9636244STvrtko Ursulin
13c9636244STvrtko Ursulinmain: $(OFILES)
14c9636244STvrtko Ursulin
15c9636244STvrtko Ursulinclean:
16c9636244STvrtko Ursulin	$(RM) $(TARGETS) $(OFILES) scatterlist.c linux/scatterlist.h linux/highmem.h linux/kmemleak.h asm/io.h
17c9636244STvrtko Ursulin	@rmdir asm
18c9636244STvrtko Ursulin
19c9636244STvrtko Ursulinscatterlist.c: ../../../lib/scatterlist.c
20c9636244STvrtko Ursulin	@sed -e 's/^static //' -e 's/__always_inline //' -e 's/inline //' < $< > $@
21c9636244STvrtko Ursulin
22c9636244STvrtko Ursulin.PHONY: include
23c9636244STvrtko Ursulin
24c9636244STvrtko Ursulininclude: ../../../include/linux/scatterlist.h
25c9636244STvrtko Ursulin	@mkdir -p linux
26c9636244STvrtko Ursulin	@mkdir -p asm
27c9636244STvrtko Ursulin	@touch asm/io.h
28c9636244STvrtko Ursulin	@touch linux/highmem.h
29c9636244STvrtko Ursulin	@touch linux/kmemleak.h
30c9636244STvrtko Ursulin	@cp $< linux/scatterlist.h
31