1 2all: traceback.o 3 4CFLAGS += -I . 5 6kallsyms.o: kallsyms.c 7 $(CC) -o kallsyms kallsyms.c 8 rm -rf kallsyms.o 9 10traceback.o: traceback/traceback.c 11 $(CC) $(CFLAGS) -c traceback/traceback.c -o traceback/traceback.o 12 13 14# 生成内核栈符号表的汇编文件 15generate_kallsyms: kallsyms.o 16 echo "Generating kallsyms..." 17 18 nm -n $(kernel_root_path)/kernel | ./kallsyms > kallsyms.S 19 $(CC) -c kallsyms.S -o kallsyms.o 20 @echo "Kallsyms generated." 21 22 23clean: 24 rm -rf kallsyms