From 86f55a41ef6eea58f86912f50473c4f6afa5d755 Mon Sep 17 00:00:00 2001 From: Mathieu Maret Date: Fri, 20 Jul 2018 17:10:58 +0200 Subject: [PATCH] Can generate symbole file --- Makefile | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/Makefile b/Makefile index d629bea..a36eb97 100644 --- a/Makefile +++ b/Makefile @@ -2,9 +2,9 @@ CPPFLAGS = -MMD AS=nasm ASFLAGS += -f elf32 -LDFLAGS += -m32 -nostdlib -static -fno-common -fno-use-cxa-atexit -fno-exceptions -fno-non-call-exceptions -fno-weak -fno-rtti -fno-stack-protector -CFLAGS += -m32 -Wall -Wextra -Werror -ffreestanding -fno-exceptions -fno-pie -fno-stack-protector -CXXFLAGS += -m32 -Wall -Wextra -Werror -ffreestanding -fno-exceptions -fno-rtti -fno-pie +LDFLAGS += -g -m32 -nostdlib -static -fno-common -fno-use-cxa-atexit -fno-exceptions -fno-non-call-exceptions -fno-weak -fno-rtti -fno-stack-protector +CFLAGS += -g -m32 -Wall -Wextra -Werror -ffreestanding -fno-exceptions -fno-pie -fno-stack-protector +CXXFLAGS += -g -m32 -Wall -Wextra -Werror -ffreestanding -fno-exceptions -fno-rtti -fno-pie SUBDIRS := core drivers @@ -18,6 +18,9 @@ deps = $(csrc:%.c=%.d) kernel:$(asmobj) $(cobj) linker.ld $(CC) -m32 -ffreestanding -nostdlib $(cobj) $(asmobj) -o $@ -T linker.ld + objcopy --only-keep-debug $@ $@.sym + objcopy --strip-debug $@ + @@ -41,7 +44,7 @@ test:kernel qemu-system-x86_64 -kernel $< clean: - $(RM) kernel $(asmobj) $(cobj) $(deps) + $(RM) kernel $(asmobj) $(cobj) $(deps) fd.iso kernel.sym ifneq ($(MAKECMDGOALS),clean) -include $(deps)