scc

simple C compiler
git clone git://git.2f30.org/scc
Log | Files | Refs | README | LICENSE

commit 81c72588ffc4ab7139aca57d2a0121c263f99af2
parent 58149ef559f52ec3e1604513f15c776f59065eca
Author: Roberto E. Vargas Caballero <k0ga@shike2.com>
Date:   Sat,  2 Nov 2013 08:38:18 +0100

Fix generation of makefile dependencies

Diffstat:
MMakefile | 20++++++++------------
1 file changed, 8 insertions(+), 12 deletions(-)

diff --git a/Makefile b/Makefile @@ -1,23 +1,20 @@ OBJS = types.o decl.o lex.o error.o symbol.o flow.o main.o expr.o \ wrapper.o tree.o -LIBS = all: kcc kcc: $(OBJS) $(CC) $(LDFLAGS) $(CFLAGS) $(LIBS) $(OBJS) -o $@ -%.d: %.c - $(CC) -M $(CPPFLAGS) $< | \ - sed -e 's,/usr/[^ ]*,,g' | \ - egrep -v '^ *\\$$' > $@ - .PHONY: clean distclean dep -dep: $(OBJS:.o=.d) - cat Makefile $? > makefile - rm -f *.d +dep: + (cat Makefile; \ + for i in $(OBJS:.o=.c); \ + do \ + $(CC) -MM $(CPPFLAGS) $$i; \ + done) > makefile clean: rm -f $(OBJS) @@ -25,9 +22,8 @@ clean: distclean: clean rm -f *~ - rm -f *.d + rm -f tags + rm -f cscope.* rm -f makefile - - ###Dependencies