Can generate symbole file

This commit is contained in:
Mathieu Maret 2018-07-20 17:10:58 +02:00
parent 84d421a014
commit 86f55a41ef
1 changed files with 7 additions and 4 deletions

View File

@ -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)