automatic creation of a seperate file, which includes all debug symbols

git-svn-id: http://svn.lfbs.rwth-aachen.de/svn/scc/trunk/MetalSVM@207 315a16e6-25f9-4109-90ae-ca3045a26c18
This commit is contained in:
stefan 2010-10-27 05:57:39 +00:00
parent 9cbe8781b2
commit 94406fc740

View file

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