gcc and bootstrap are in agreement!

This commit is contained in:
pommicket 2022-02-19 18:22:57 -08:00
parent 7deda52af6
commit 54a191a117
4 changed files with 133 additions and 41 deletions

View file

@ -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]