aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHenry Kroll III <henry@comptune.com>2010-04-26 23:20:35 -0700
committerHenry Kroll III <henry@comptune.com>2010-04-26 23:20:35 -0700
commit209caeedeee1f7fd154dbd0c5ea908314f6a2f87 (patch)
tree319803bc00f2440444e311e9928569dd4a6a448a
parentac0b7d82d8a3fbfb6c524a9470db3d6195ccb909 (diff)
downloadtinycc-209caeedeee1f7fd154dbd0c5ea908314f6a2f87.tar.gz
tinycc-209caeedeee1f7fd154dbd0c5ea908314f6a2f87.tar.bz2
Summary of commits + added some brief comments to Makefile
Summary of what was changed or added so far: These won't work on Win32 * --disable-static option builds libtcca.so.1.0 and associated simlinks. This replaces libtcca.a, which is a static library with a dynamic one. * --with-selinux option uses mmap to enable tcc -run to work with Selinux. * attempt to build tcc1.def on i386 / x86_64 when --enable-cross is used. If successful, this gets around the "_start not found" or "_winstart not found" messages when i386-win32-tcc is run on these systems. I say "if" because it gave me fits of trouble on my system and not all others have been tested yet. tcc1.def is not a real .def file by the way, but it works, so it's kind of a dancing bear at this point. We're not concerned that it's getting the steps wrong. We're just happy it's not eating us for lunch.
-rw-r--r--Makefile15
1 files changed, 10 insertions, 5 deletions
diff --git a/Makefile b/Makefile
index 63e2a26..d2e7883 100644
--- a/Makefile
+++ b/Makefile
@@ -114,22 +114,24 @@ endif
endif
endif
+# LIBTCCB decides whether libtcc is installed static or dynamic
LIBTCCB=libtcc.a
ifdef DISABLE_STATIC
CFLAGS+=-fPIC
LIBTCCL=-L. -ltcc
LIBTCCB=libtcc.so.1.0
endif
-LIBTCCPROGS=$(LIBTCCB)
+LIBTCCLIBS=$(LIBTCCB)
ifdef CONFIG_CROSS
PROGS+=$(PROGS_CROSS)
+# Try to build win32 cross-compiler lib on *nix
ifndef CONFIG_WIN32
-LIBTCCPROGS+=tcc1.def
+LIBTCCLIBS+=tcc1.def
endif
endif
-all: $(PROGS) $(LIBTCC1) $(BCHECK_O) $(LIBTCCPROGS) tcc-doc.html tcc.1 libtcc_test$(EXESUF)
+all: $(PROGS) $(LIBTCC1) $(BCHECK_O) $(LIBTCCLIBS) tcc-doc.html tcc.1 libtcc_test$(EXESUF)
# Host Tiny C Compiler
tcc$(EXESUF): tcc.o $(LIBTCCB)
@@ -182,7 +184,10 @@ libtcc.so.1.0: $(LIBTCC_OBJ)
libtcc_test$(EXESUF): tests/libtcc_test.c $(LIBTCCB)
$(CC) -o $@ $^ -I. $(CFLAGS) $(LIBS) $(LIBTCCL)
-
+
+# To build cross-compilers on Linux we must make a fake 32 bit tcc.exe
+# and use it to build ELF objects into libtcc1.a which is then
+# renamed to tcc1.def in order to have another target in the Makefile
tcc1.def:
mv config.mak config.mak.bak
mv config.h config.h.bak
@@ -240,7 +245,7 @@ TCC_INCLUDES = stdarg.h stddef.h stdbool.h float.h varargs.h tcclib.h
INSTALL=install
ifndef CONFIG_WIN32
-install: $(PROGS) $(LIBTCC1) $(BCHECK_O) $(LIBTCCPROGS) tcc.1 tcc-doc.html
+install: $(PROGS) $(LIBTCC1) $(BCHECK_O) $(LIBTCCLIBS) tcc.1 tcc-doc.html
mkdir -p "$(bindir)"
$(INSTALL) -s -m755 $(PROGS) "$(bindir)"
mkdir -p "$(mandir)/man1"