aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/rules.make18
1 files changed, 10 insertions, 8 deletions
diff --git a/include/rules.make b/include/rules.make
index b2b6336..b1b5f17 100644
--- a/include/rules.make
+++ b/include/rules.make
@@ -1,22 +1,24 @@
-CC=diet gcc
+CC_ORIG := $(CC)
+CC := diet $(CC)
+
CFLAGS=$(GCC_ARCH_SMALL) $(GCC_CPU_SMALL) $(GCC_OPT_SMALL)
#-mpreferred-stack-boundary=2 -malign-jumps=0 -malign-loops=0 -malign-functions=0 -Os -march=i386 -mcpu=i386
-LDFLAGS=-s
+LDFLAGS=-s -Wl,--gc-sections
all: $(OBJS)
%: %.c
$(CC) $(LDFLAGS) $(CFLAGS) -o $@ $<
- strip -R .comment -R .note $@
- objdump -h $@ | grep -q '\.data[ ]*00000000' && strip -R .data $@ || true
- objdump -h $@ | grep -q '\.sbss[ ]*00000000' && strip -R .sbss $@ || true
+ $(STRIP) -x --strip-unneeded -R .comment -R .note $@
+ $(OBJDUMP) -h $@ | grep -q '\.data[ ]*00000000' && $(STRIP) -R .data $@ || true
+ $(OBJDUMP) -h $@ | grep -q '\.sbss[ ]*00000000' && $(STRIP) -R .sbss $@ || true
-sstrip $@
%-debug: %.c
$(CC) $(LDFLAGS) $(CFLAGS) -DDEBUG -o $@ $<
- strip -R .comment -R .note $@
- objdump -h $@ | grep -q '\.data[ ]*00000000' && strip -R .data $@ || true
- objdump -h $@ | grep -q '\.sbss[ ]*00000000' && strip -R .sbss $@ || true
+ $(STRIP) -x --strip-unneeded -R .comment -R .note $@
+ $(OBJDUMP) -h $@ | grep -q '\.data[ ]*00000000' && $(STRIP) -R .data $@ || true
+ $(OBJDUMP) -h $@ | grep -q '\.sbss[ ]*00000000' && $(STRIP) -R .sbss $@ || true
clean:
@rm -f *.[ao] *~ core