Commit Diff


commit - b727d19e2033bbdebfa32a77fb325cd00368c0c2
commit + 64cf3b3c40b18d83801e4e7b16cadc09546f9951
blob - 8fea3b2ab4675ba03765c41fcccfe0b1ce8e9085
blob + d61880a005e348b3a88596261091843858848c1a
--- cc/cc1/MyMakefile
+++ cc/cc1/MyMakefile
@@ -1,6 +1,5 @@
 YFLAGS = -d -v
 CFLAGS = -ansi -g -O0 -Wall -Wno-deprecated-non-prototype -Wno-comment -Wno-implicit-int
-OBJ = lex.o parse.o gen.o main.o
 
 all: cc1
 
@@ -13,20 +12,16 @@ run: cc1
 	nasm -fbin -o /dev/null test.asm
 	(echo '=== IR ==='; cat test.ir; echo '=== ASM ==='; cat test.asm) | less
 
-cc1: ${OBJ}
-	${CC} -o $@ ${OBJ} ${CFLAGS}
+cc1: lex.o parse.o gen.o main.o
+	${CC} -o $@ $* ${CFLAGS}
 
 parse.o y.tab.h: parse.y ../yacc/yacc
 	${YACC} ${YFLAGS} parse.y
 	${CC} -c -o parse.o y.tab.c ${CFLAGS}
 	rm -f y.tab.c
 
-lex.o: lex.c cc1.h y.tab.h
-	${CC} -c -o $@ lex.c ${CFLAGS}
+lex.o: cc1.h y.tab.h
+gen.o: cc1.h
+main.o: cc1.h y.tab.h
 
-gen.o: gen.c cc1.h
-	${CC} -c -o $@ gen.c ${CFLAGS}
 
-main.o: main.c cc1.h y.tab.h
-	${CC} -c -o $@ main.c ${CFLAGS}
-
blob - 4a8c0832c2a87c79be031c3cd217dd8449b9c181
blob + 105c712cb4c1b3fce9ca243722632ca420e91d55
--- cc/cpp/MyMakefile
+++ cc/cpp/MyMakefile
@@ -1,5 +1,4 @@
 CFLAGS = -g -O0 -ansi -Wno-deprecated-non-prototype -Wno-comment -DFLEXNAMES -DBSD2_86 -Di286=1 -Dunix
-OBJ = cpp.o cpy.o
 
 all: cpp
 
@@ -9,12 +8,9 @@ clean:
 test: cpp
 	./cpp -P < cpp.c | grep -v '^$$'
 
-cpp: ${OBJ}
-	${CC} -o $@ ${OBJ} ${CFLAGS}
+cpp: cpp.o cpy.o
+	${CC} -o $@ $* ${CFLAGS}
 
-cpp.o: cpp.c
-	${CC} -c -o $@ cpp.c ${CFLAGS}
-
 cpy.o: cpy.y yylex.c ../yacc/yacc
 	${YACC} cpy.y
 	${CC} -c -o $@ y.tab.c ${CFLAGS}
blob - 8d50f5a33abe9dcfb30c8a68e6ac43a066c9ff6c
blob + cf445754b4dfd04e27641936ae78bf18b03c431f
--- cc/irc/MyMakefile
+++ cc/irc/MyMakefile
@@ -9,6 +9,3 @@ run: all
 	./irc < test.ir > test.asm
 	nasm -fobj -o /dev/null test.asm
 	less test.asm
-
-irc: irc.c
-	${CC} -o $@ irc.c ${CFLAGS}
blob - 6bd38c2a5b8ed372596d0b4927c11a7e00e7d307
blob + 57980bfc0e24ed96323ce18279512096984b49dd
--- cc/yacc/MyMakefile
+++ cc/yacc/MyMakefile
@@ -6,7 +6,7 @@ SRC != echo y?.c
 all: yacc calc
 
 yacc: ${SRC}
-	${CC} -o $@ ${SRC} ${CFLAGS} ${CPPFLAGS}
+	${CC} -o $@ $* ${CFLAGS} ${CPPFLAGS}
 
 clean:
 	rm -f yacc *.o *.core y.tab.c calc.c