aboutsummaryrefslogtreecommitdiff
path: root/include/rules.make
diff options
context:
space:
mode:
Diffstat (limited to 'include/rules.make')
-rw-r--r--include/rules.make10
1 files changed, 8 insertions, 2 deletions
diff --git a/include/rules.make b/include/rules.make
index b1b5f17..8e4c36d 100644
--- a/include/rules.make
+++ b/include/rules.make
@@ -1,5 +1,11 @@
+CC ?= gcc
+STRIP ?= strip
+OBJDUMP ?= objdump
+SSTRIP ?= sstrip
+DIET ?= diet
+
CC_ORIG := $(CC)
-CC := diet $(CC)
+override CC := $(DIET) -Os $(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
@@ -12,7 +18,7 @@ all: $(OBJS)
$(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 $@
+ -if [ -n "$(SSTRIP)" ]; then $(SSTRIP) $@ ; fi
%-debug: %.c
$(CC) $(LDFLAGS) $(CFLAGS) -DDEBUG -o $@ $<