create a seperate symbol-file to decrease the size of the executables files

This commit is contained in:
Stefan Lankes 2011-02-17 09:25:40 +01:00
parent 833513397f
commit c611b609c1

View file

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