diff --git a/Makefile.example b/Makefile.example index 03dd3668..57c6cd93 100644 --- a/Makefile.example +++ b/Makefile.example @@ -1,16 +1,20 @@ export TOPDIR = $(shell pwd) export ARCH = x86 NAME = metalsvm.bin +SYM_NAME = metalsvm.sym KERNDIRS = libkern kernel mm fs arch lwip drivers SUBDIRS = libgloss $(KERNDIRS) OBJS = $(shell for i in $(KERNDIRS); do find $$i -name *.o; done) +OBJCOPY = objcopy +STRIP_DEBUG = --strip-debug +KEEP_DEBUG = --only-keep-debug export MAKE = make export ASM = nasm -export ASMFLAGS = -felf32 +export ASMFLAGS = -felf32 -g export INCLUDE = -I$(TOPDIR)/include -I$(TOPDIR)/arch/$(ARCH)/include -I$(TOPDIR)/lwip/src/include -I$(TOPDIR)/lwip/src/include/ipv4 export CC = gcc -export CFLAGS = -m32 -march=i386 -Wall -O2 -fno-zero-initialized-in-bss -fno-builtin-function -fstrength-reduce -fomit-frame-pointer -finline-functions -nostdinc $(INCLUDE) -fno-stack-protector +export CFLAGS = -g -m32 -march=i386 -Wall -O2 -fno-zero-initialized-in-bss -fno-builtin-function -fstrength-reduce -fomit-frame-pointer -finline-functions -nostdinc $(INCLUDE) -fno-stack-protector export AR = ar export ARFLAGS = rsv export RM = rm -rf @@ -26,10 +30,12 @@ all: $(MAKE) link link: - $(LD) $(LDFLAGS) -o $(NAME) $(OBJS) + $(LD) $(LDFLAGS) -o $(NAME) $(OBJS) + $(OBJCOPY) $(KEEP_DEBUG) $(NAME) $(SYM_NAME) + $(OBJCOPY) $(STRIP_DEBUG) $(NAME) clean: - $(RM) $(NAME) *~ + $(RM) $(NAME) $(SYM_NAME) *~ for i in $(SUBDIRS); do $(MAKE) -k -C $$i clean; done depend: