0001
0002
0003
0004
0005 CFLAGS += -I. -I../../include -Wall -O2 -fsanitize=address \
0006 -fsanitize=undefined -D CONFIG_PHYS_ADDR_T_64BIT
0007 LDFLAGS += -fsanitize=address -fsanitize=undefined
0008 TARGETS = main
0009 TEST_OFILES = tests/alloc_nid_api.o tests/alloc_helpers_api.o tests/alloc_api.o \
0010 tests/basic_api.o tests/common.o
0011 DEP_OFILES = memblock.o lib/slab.o mmzone.o slab.o
0012 OFILES = main.o $(DEP_OFILES) $(TEST_OFILES)
0013 EXTR_SRC = ../../../mm/memblock.c
0014
0015 ifeq ($(BUILD), 32)
0016 CFLAGS += -m32
0017 LDFLAGS += -m32
0018 endif
0019
0020
0021 include scripts/Makefile.include
0022
0023 main: $(OFILES)
0024
0025 $(OFILES): include
0026
0027 include: ../../../include/linux/memblock.h ../../include/linux/*.h \
0028 ../../include/asm/*.h
0029
0030 @mkdir -p linux
0031 test -L linux/memblock.h || ln -s ../../../../include/linux/memblock.h linux/memblock.h
0032 test -L asm/cmpxchg.h || ln -s ../../../arch/x86/include/asm/cmpxchg.h asm/cmpxchg.h
0033
0034 memblock.c: $(EXTR_SRC)
0035 test -L memblock.c || ln -s $(EXTR_SRC) memblock.c
0036
0037 clean:
0038 $(RM) $(TARGETS) $(OFILES) linux/memblock.h memblock.c asm/cmpxchg.h
0039
0040 help:
0041 @echo 'Memblock simulator'
0042 @echo ''
0043 @echo 'Available targets:'
0044 @echo ' main - Build the memblock simulator'
0045 @echo ' clean - Remove generated files and symlinks in the directory'
0046 @echo ''
0047 @echo 'Configuration:'
0048 @echo ' make MEMBLOCK_DEBUG=1 - enable memblock_dbg() messages'
0049 @echo ' make NUMA=1 - simulate enabled NUMA'
0050 @echo ' make 32BIT_PHYS_ADDR_T=1 - Use 32 bit physical addresses'
0051
0052 vpath %.c ../../lib
0053
0054 .PHONY: clean include help