summaryrefslogtreecommitdiff
path: root/05
diff options
context:
space:
mode:
Diffstat (limited to '05')
-rw-r--r--05/.gitignore2
-rw-r--r--05/Makefile14
-rw-r--r--05/musl-0.6.0/Makefile4
-rw-r--r--05/musl-0.6.0/config.mak4
-rw-r--r--05/tcc-0.9.27/config.h4
5 files changed, 18 insertions, 10 deletions
diff --git a/05/.gitignore b/05/.gitignore
index 7f437b0..e2ef208 100644
--- a/05/.gitignore
+++ b/05/.gitignore
@@ -1,3 +1,5 @@
in04
address_map.txt
*.o
+tcc-bootstrap
+musl-bootstrap \ No newline at end of file
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]
diff --git a/05/musl-0.6.0/Makefile b/05/musl-0.6.0/Makefile
index 9d40be5..460ff31 100644
--- a/05/musl-0.6.0/Makefile
+++ b/05/musl-0.6.0/Makefile
@@ -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) $@
diff --git a/05/musl-0.6.0/config.mak b/05/musl-0.6.0/config.mak
index 55a18ae..81b8052 100644
--- a/05/musl-0.6.0/config.mak
+++ b/05/musl-0.6.0/config.mak
@@ -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
diff --git a/05/tcc-0.9.27/config.h b/05/tcc-0.9.27/config.h
index 2ed06d9..f49b07c 100644
--- a/05/tcc-0.9.27/config.h
+++ b/05/tcc-0.9.27/config.h
@@ -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