Makefile 786 B

1234567891011121314151617181920212223242526272829303132
  1. # SPDX-License-Identifier: GPL-2.0-only
  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. ifeq ($(BUILD), 32)
  7. CFLAGS += -m32
  8. LDFLAGS += -m32
  9. endif
  10. targets: include $(TARGETS)
  11. main: $(OFILES)
  12. clean:
  13. $(RM) $(TARGETS) $(OFILES) scatterlist.c linux/scatterlist.h linux/highmem.h linux/kmemleak.h linux/slab.h asm/io.h
  14. @rmdir asm
  15. scatterlist.c: ../../../lib/scatterlist.c
  16. @sed -e 's/^static //' -e 's/__always_inline //' -e 's/inline //' < $< > $@
  17. .PHONY: include
  18. include: ../../../include/linux/scatterlist.h
  19. @mkdir -p linux
  20. @mkdir -p asm
  21. @touch asm/io.h
  22. @touch linux/highmem.h
  23. @touch linux/kmemleak.h
  24. @touch linux/slab.h
  25. @cp $< linux/scatterlist.h