Makefile: add a special rule for sed
authorAlan Cox <alan@linux.intel.com>
Fri, 2 Jan 2015 11:33:25 +0000 (11:33 +0000)
committerAlan Cox <alan@linux.intel.com>
Fri, 2 Jan 2015 11:33:25 +0000 (11:33 +0000)
sed needs to be built with lower optimisation or sdcc runs for hours

Applications/util/Makefile

index 02e0fe9..0f6c615 100644 (file)
@@ -7,7 +7,9 @@ PROGLOAD=`(cat ../../Kernel/platform/config.h; echo PROGLOAD) | cpp -E | tail -n
 
 #CC_OPT = -mz80 -c --opt-code-size --std-c89 --max-allocs-per-node 2000000 -I../../Library/include
 CC_OPT = -mz80 --std-c99 -c --opt-code-size --max-allocs-per-node 20000 -I../../Library/include
-#--oldralloc
+
+# Used for programs that make sdcc go boom or take hours
+CC_CRAP = -mz80 --std-c99 -c --opt-code-size --max-allocs-per-node 1000 -I../../Library/include
 ASM_OPT = -l -o -s
 LINKER_OPT = -mz80 --nostdlib --no-std-crt0 --code-loc $(PROGLOAD) --data-loc  0
 BINMAN = ../../Library/tools/binman
@@ -68,7 +70,6 @@ SRCS  = banner.c \
        pwd.c \
        rm.c \
        rmdir.c \
-       sed.c \
        sleep.c \
        ssh.c \
        sort.c \
@@ -94,16 +95,22 @@ SRCS  = banner.c \
        xargs.c \
        yes.c
 
+SRCSBAD = sed.c
+
 OBJS = $(SRCS:.c=.rel)
+OBJSBAD = $(SRCSBAD:.c=.rel)
 
 LIBS = ../../Library/libs/syslib.lib
 
-APPS = $(OBJS:.rel=)
+APPS = $(OBJS:.rel=) $(OBJSBAD:.rel=)
 
 all: $(APPS)
 
 $(OBJS): $(SRCS)
 
+$(OBJSBAD): $(SRCSBAD)
+       $(CC) $(CC_CRAP) $(@:.rel=.c)
+
 .c.rel:
        $(CC) $(CC_OPT) $(@:.rel=.c)