From c611b609c11a02942946d0d82b502510fcf03f3a Mon Sep 17 00:00:00 2001 From: Stefan Lankes Date: Thu, 17 Feb 2011 09:25:40 +0100 Subject: [PATCH] create a seperate symbol-file to decrease the size of the executables files --- newlib/examples/Makefile | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/newlib/examples/Makefile b/newlib/examples/Makefile index 6eaa1af8..5e712ac1 100644 --- a/newlib/examples/Makefile +++ b/newlib/examples/Makefile @@ -2,8 +2,11 @@ ARCH = x86 NEWLIB = ../x86/i586-metalsvm-elf32 MAKE = make CC = gcc -CFLAGS = -m32 -O2 -nostdinc -Wall -fno-builtin -I$(NEWLIB)/include -I../../include -I../../arch/$(ARCH)/include -fno-stack-protector +CFLAGS = -g -m32 -O2 -nostdinc -Wall -fno-builtin -I$(NEWLIB)/include -I../../include -I../../arch/$(ARCH)/include -fno-stack-protector LDFLAGS = -m32 -nostdlib -L$(NEWLIB)/lib +OBJCOPY = objcopy +STRIP_DEBUG = --strip-debug +KEEP_DEBUG = --only-keep-debug # other implicit rules %.o : %.c @@ -15,12 +18,16 @@ all: hello test_fork test_fork: test_fork.o $(CC) -T link.ld -o $@ $(LDFLAGS) $< + $(OBJCOPY) $(KEEP_DEBUG) $@ $@.sym + $(OBJCOPY) $(STRIP_DEBUG) $@ hello: hello.o $(CC) -T link.ld -o $@ $(LDFLAGS) $< + $(OBJCOPY) $(KEEP_DEBUG) $@ $@.sym + $(OBJCOPY) $(STRIP_DEBUG) $@ clean: - $(RM) hello test_fork *.o *~ + $(RM) hello test_fork *.sym *.o *~ depend: $(CC) -MM $(CFLAGS) *.c > Makefile.dep