create a seperate symbol-file to decrease the size of the executables files
This commit is contained in:
parent
833513397f
commit
c611b609c1
1 changed files with 9 additions and 2 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Reference in a new issue