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