testing bootstrap

This commit is contained in:
Dawid Sobczak 2023-07-01 19:19:53 +01:00 committed by pommicket
parent 5e2d856b03
commit fe7a0abd38
6 changed files with 22 additions and 11 deletions

2
05/.gitignore vendored
View file

@ -1,3 +1,5 @@
in04
address_map.txt
*.o
tcc-bootstrap
musl-bootstrap

View file

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

View file

@ -9,7 +9,7 @@
#
CC = ../tcc-0.9.27/tcc0
exec_prefix = /usr/local/musl-bootstrap
exec_prefix = ../musl-bootstrapU
bindir = $(exec_prefix)/bin
prefix = /usr/local/musl-bootstrap
@ -84,7 +84,7 @@ lib/libc.so: $(LOBJS)
$(OBJCOPY) --weaken $@
lib/libc.a: $(OBJS)
rm -f $@
mkdir -p lib
$(AR) rc $@ $(OBJS)
# $(RANLIB) $@

View file

@ -6,10 +6,10 @@
ARCH = x86_64
# Installation prefix. DO NOT use /, /usr, or /usr/local !
prefix = /usr/local/musl-bootstrap
prefix = ../musl-bootstrap
# Installation prefix for musl-gcc compiler wrapper.
exec_prefix = /usr/local/musl-bootstrap
exec_prefix = ../musl-bootstrap
# Uncomment if you want to build i386 musl on a 64-bit host
#CFLAGS += -m32

View file

@ -2,6 +2,6 @@
#define CONFIG_TCC_STATIC 1
#define TCC_TARGET_X86_64 1
#define ONE_SOURCE 1
#define CONFIG_LDDIR "lib/x86_64-linux-gnu"
#define CONFIG_TCCDIR "/usr/local/lib/tcc-bootstrap"
//#define CONFIG_LDDIR "lib/x86_64-linux-gnu"
#define CONFIG_TCCDIR "../tcc-bootstrap"
#define inline

View file

@ -6,7 +6,9 @@ all: markdown README.html
$(MAKE) -C 04
$(MAKE) -C 04a
# don't compile all of 05 because it takes a while
$(MAKE) -C 05 README.html
$(MAKE) -C 05
$(MAKE) -C 05 install
$(MAKE) -C 05 tcc
clean:
$(MAKE) -C 00 clean
$(MAKE) -C 01 clean
@ -14,6 +16,7 @@ clean:
$(MAKE) -C 03 clean
$(MAKE) -C 04 clean
$(MAKE) -C 04a clean
$(MAKE) -C 05 clean
rm -f markdown
rm -f README.html
markdown: markdown.c