summaryrefslogtreecommitdiff
path: root/05/Makefile
diff options
context:
space:
mode:
Diffstat (limited to '05/Makefile')
-rw-r--r--05/Makefile16
1 files changed, 11 insertions, 5 deletions
diff --git a/05/Makefile b/05/Makefile
index b7dccab..ea0d9c4 100644
--- a/05/Makefile
+++ b/05/Makefile
@@ -1,8 +1,8 @@
TCCDIR=tcc-0.9.27
-TCC0=$(TCCDIR)/tcc0
-TCC1=$(TCCDIR)/tcc1
+TCC=$(TCCDIR)/tcc
+TCC0=$(TCC)0
TCCINST=/usr/local/lib/tcc-bootstrap
-all: out04 a.out test.out README.html $(TCCDIR)/lib/libtcc1.a
+all: out04 a.out README.html $(TCCDIR)/lib/libtcc1.a
in04: *.b ../04a/out04
../04a/out04 main.b in04
out04: in04 ../04/out03
@@ -13,7 +13,7 @@ out04: in04 ../04/out03
./out04 $< $@
a.out: main.c *.h out04
./out04
-test.out: $(TCC0) test.s.o test.c.o
+test.out: test.s.o test.c.o
$(TCC0) -static -nostdlib test.s.o test.c.o -o test.out
test.s.o: $(TCC0) test.s
$(TCC0) -static -nostdlib -c test.s -o test.s.o
@@ -31,7 +31,13 @@ install-tcc0: $(TCCDIR)/lib/libtcc1.a $(TCCDIR)/include/*.h
mkdir -p $(TCCINST)/include
cp -r $(TCCDIR)/include/*.h $(TCCINST)/include/
cp -r $(TCCDIR)/lib/libtcc1.a $(TCCINST)/
-$(TCC1): $(TCC0) $(TCCINST)/libtcc1.a
+$(TCC)1: $(TCC0) $(TCCINST)/libtcc1.a
cd $(TCCDIR) && ./tcc0 tcc.c -o tcc1
+$(TCC)2: $(TCC)1
+ cd $(TCCDIR) && ./tcc1 tcc.c -o tcc2
+$(TCC)0a: $(TCCDIR)/*.c $(TCCDIR)/*.h
+ cd $(TCCDIR) && gcc tcc.c -o tcc0a
+$(TCC)1a: $(TCCDIR)/*.c $(TCCDIR)/*.h
+ cd $(TCCDIR) && ./tcc0a tcc.c -o tcc1a
clean:
rm -f out* README.html *.out *.o $(TCCDIR)/tcc[0123456] $(TCCDIR)/tcc[0123456]a $(TCCDIR)/lib/*.[oa]