summaryrefslogtreecommitdiff
path: root/05/Makefile
diff options
context:
space:
mode:
Diffstat (limited to '05/Makefile')
-rw-r--r--05/Makefile14
1 files changed, 10 insertions, 4 deletions
diff --git a/05/Makefile b/05/Makefile
index ea0d9c4..01194ff 100644
--- a/05/Makefile
+++ b/05/Makefile
@@ -1,8 +1,8 @@
TCCDIR=tcc-0.9.27
TCC=$(TCCDIR)/tcc
TCC0=$(TCC)0
-TCCINST=/usr/local/lib/tcc-bootstrap
-all: out04 a.out README.html $(TCCDIR)/lib/libtcc1.a
+TCCINST=tcc-bootstrap
+all: out04 a.out $(TCCDIR)/lib/libtcc1.a
in04: *.b ../04a/out04
../04a/out04 main.b in04
out04: in04 ../04/out03
@@ -27,12 +27,16 @@ $(TCCDIR)/lib/libtcc1.a: $(TCC0) $(TCCDIR)/lib/*.[cS]
$(TCC0) -c $(TCCDIR)/lib/va_list.c -o $(TCCDIR)/lib/va_list.o
$(TCC0) -c $(TCCDIR)/lib/libtcc1.c -o $(TCCDIR)/lib/libtcc1.o
$(TCC0) -ar $(TCCDIR)/lib/libtcc1.a $(TCCDIR)/lib/*.o
-install-tcc0: $(TCCDIR)/lib/libtcc1.a $(TCCDIR)/include/*.h
+install: $(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)/
+ $(MAKE) -C musl-0.6.0
+ $(MAKE) -C musl-0.6.0 install
$(TCC)1: $(TCC0) $(TCCINST)/libtcc1.a
- cd $(TCCDIR) && ./tcc0 tcc.c -o tcc1
+ cd $(TCCDIR) && ./tcc0 -nostdinc -nostdlib -B ../tcc-boostrap -L../musl-bootstrap/lib -lc -I ../musl-bootstrap/include tcc.c -o tcc1
+tcc: $(TCC)1
+
$(TCC)2: $(TCC)1
cd $(TCCDIR) && ./tcc1 tcc.c -o tcc2
$(TCC)0a: $(TCCDIR)/*.c $(TCCDIR)/*.h
@@ -40,4 +44,6 @@ $(TCC)0a: $(TCCDIR)/*.c $(TCCDIR)/*.h
$(TCC)1a: $(TCCDIR)/*.c $(TCCDIR)/*.h
cd $(TCCDIR) && ./tcc0a tcc.c -o tcc1a
clean:
+ rm -rf musl-bootstrap
+ rm -rf tcc-bootstrap
rm -f out* README.html *.out *.o $(TCCDIR)/tcc[0123456] $(TCCDIR)/tcc[0123456]a $(TCCDIR)/lib/*.[oa]