diff options
| author | grischka <grischka> | 2017-10-11 18:13:43 +0200 |
|---|---|---|
| committer | grischka <grischka> | 2017-10-11 18:13:43 +0200 |
| commit | da8c62f75d893449e232944fc62566c020b4d010 (patch) | |
| tree | 977fec8d53d90ceb8c718f07f47c2bc9cbd6edfc /win32/Makefile | |
| parent | faa9744f5d13c94c7298bf08e8d1eedca5db88a9 (diff) | |
| download | tinycc-da8c62f75d893449e232944fc62566c020b4d010.tar.gz tinycc-da8c62f75d893449e232944fc62566c020b4d010.tar.bz2 | |
various stuff
win32/Makefile ("for cygwin") removed
- On cygwin, the normal ./configure && make can be used with either
cygwin's "GCC for Win32 Toolchain"
./configure --cross-prefix=i686-w64-mingw32-
or with an existing tcc:
./configure --cc=<old-tccdir>/tcc.exe
tcctest.c:
- exclude test_high_clobbers() on _WIN64 (does not work)
tests2/95_bitfield.c:
- use 'signed char' for ARM (where default 'char' is unsigned)
tests:
- remove -I "expr" diff option to allow tests with
busybox-diff.
libtcc.c, tcc.c:
- removed -iwithprefix option. It is supposed to be
combined with -iprefix which we don't have either.
tccgen.c:
- fix assignments and return of 'void', as in
void f() {
void *p, *q;
*p = *q:
return *p;
}
This appears to be allowed but should do nothing.
tcc.h, libtcc.c, tccpp.c:
- Revert "Introduce VIP sysinclude paths which are always searched first"
This reverts commit 1d5e386b0a78393ac6b670c209a185849ec798a1.
The patch was giving tcc's system includes priority over -I which
is not how it should be.
tccelf.c:
- add DT_TEXTREL tag only if text relocations are actually
used (which is likely not the case on x86_64)
- prepare_dynamic_rel(): avoid relocation of unresolved
(weak) symbols
tccrun.c:
- for HAVE_SELINUX, use two mappings to the same (real) file.
(it was so once except the RX mapping wasn't used at all).
tccpe.c:
- fix relocation constant used for x86_64 (by Andrei E. Warentin)
- #ifndef _WIN32 do "chmod 755 ..." to get runnable exes on cygwin.
tccasm.c:
- keep forward asm labels static, otherwise they will endup
in dynsym eventually.
configure, Makefile:
- mingw32: respect ./configure options --bindir --docdir --libdir
- allow overriding tcc when building libtcc1.a and libtcc.def with
make XTCC=<tcc program to use>
- use $(wildcard ...) for install to allow installing just
a cross compiler for example
make cross-arm
make install
- use name <target>-libtcc1.a
build-tcc.bat:
- add options: -clean, -b bindir
Diffstat (limited to 'win32/Makefile')
| -rw-r--r-- | win32/Makefile | 148 |
1 files changed, 0 insertions, 148 deletions
diff --git a/win32/Makefile b/win32/Makefile deleted file mode 100644 index 5bd60bd..0000000 --- a/win32/Makefile +++ /dev/null @@ -1,148 +0,0 @@ -# -# This Makefile builds native Windows tcc for both 32 and 64 bits generator. -# It requires Cygwin 64 and gcc to bootstrap a first tcc version which is used -# by a second stage to compile tcc it self. -# Generated binaries do not require cygwin to run. -# You can launch 'tarball' target to build a tar.gz you can install on any -# Windows machines. - -CPU = $(shell if `gcc -v 2>&1 | grep Target | grep -q x86_64`; then echo 64; else echo 32; fi) -VERSION = $(shell cat ../VERSION) -BOOTCC = gcc -CFLAGS = -s -static -fno-strict-aliasing -Wno-incompatible-pointer-types -DTCC_TARGET_PE -#WINPWD = `cygpath --mixed $(PWD)` -#@echo "#define CONFIG_TCCDIR \"$(WINPWD)\"" - -ifeq ($(CPU), 64) -NATIVE = -m$(CPU) -DTCC_TARGET_X86_64 -ARCH = x86_64 -else -NATIVE = -m$(CPU) -DTCC_TARGET_I386 -ARCH = i386 -endif - -TARGET = $(CPU) - -ifeq ($(TARGET), 64) -TFLAGS = -m$(TARGET) -DTCC_TARGET_X86_64 -TARCH = x86_64 -else -TFLAGS = -m$(TARGET) -DTCC_TARGET_I386 -TARCH = i386 -endif - -all: pre bootstrap libs rebuild - @chmod 775 *.exe - @ls -ls *.exe - -pre: - @echo ARCH=$(TARCH) 1> ../config.mak - @echo TARGETOS=Windows 1>> ../config.mak - @echo CONFIG_WIN32=yes 1>> ../config.mak - @echo TOPSRC=$$\(TOP\) 1>> ../config.mak - @echo "#define TCC_VERSION \"$(VERSION)\"" 1>../config.h - @echo "#ifdef TCC_TARGET_X86_64" 1>>../config.h - @echo "#define TCC_LIBTCC1 \"libtcc1-64.a\"" 1>>../config.h - @echo "#else" 1>>../config.h - @echo "#define TCC_LIBTCC1 \"libtcc1-32.a\"" 1>>../config.h - @echo "#endif" 1>>../config.h - @echo @set VERSION $(VERSION) 1>../config.texi - @rm -f *tcc.exe tiny_*.exe *tcc.dll lib/*.a - @rm -r -f libtcc doc - @mkdir libtcc - @mkdir doc - @cp ../include/*.h include - @cp ../tcclib.h include - @cp ../libtcc.h include - @cp tcc-win32.txt doc - @cp ../tests/libtcc_test.c examples - -PHONY += pre - -bootstrap: - @echo Bootstrapping 32bits and 64bits tools with $(BOOTCC) -m$(CPU) - @$(BOOTCC) $(CFLAGS) -DTCC_TARGET_I386 -o i386-win32-tcc.exe ../tcc.c - @$(BOOTCC) $(CFLAGS) -DTCC_TARGET_X86_64 -o x86_64-win32-tcc.exe ../tcc.c - @$(BOOTCC) $(CFLAGS) $(NATIVE) -o tcc.exe ../tcc.c - @$(BOOTCC) $(CFLAGS) $(NATIVE) -DLIBTCC_AS_DLL -o libtcc.dll -shared ../libtcc.c - -PHONY += bootstrap - -lib/libtcc1-32.a: - @echo Building $*.a with tcc -m32 - @./tcc -O2 -B. -m32 -DTCC_TARGET_PE -DTCC_TARGET_I386 -c ../lib/libtcc1.c - @./tcc -O2 -B. -m32 -DTCC_TARGET_PE -DTCC_TARGET_I386 -c ../lib/alloca86.S - @./tcc -O2 -B. -m32 -DTCC_TARGET_PE -DTCC_TARGET_I386 -c ../lib/alloca86-bt.S - @./tcc -O2 -B. -m32 -DTCC_TARGET_PE -DTCC_TARGET_I386 -c lib/crt1.c - @./tcc -O2 -B. -m32 -DTCC_TARGET_PE -DTCC_TARGET_I386 -c lib/crt1w.c - @./tcc -O2 -B. -m32 -DTCC_TARGET_PE -DTCC_TARGET_I386 -c lib/wincrt1.c - @./tcc -O2 -B. -m32 -DTCC_TARGET_PE -DTCC_TARGET_I386 -c lib/wincrt1w.c - @./tcc -O2 -B. -m32 -DTCC_TARGET_PE -DTCC_TARGET_I386 -c lib/dllcrt1.c - @./tcc -O2 -B. -m32 -DTCC_TARGET_PE -DTCC_TARGET_I386 -c lib/dllmain.c - @./tcc -O2 -B. -m32 -DTCC_TARGET_PE -DTCC_TARGET_I386 -c lib/chkstk.S - @./tcc -m32 -ar lib/libtcc1-32.a libtcc1.o alloca86.o alloca86-bt.o crt1.o wincrt1.o crt1w.o wincrt1w.o dllcrt1.o dllmain.o chkstk.o - @rm *.o - -lib/libtcc1-64.a: - @echo Building $*.a with tcc -m64 - @./tcc -O2 -B. -m64 -DTCC_TARGET_PE -DTCC_TARGET_X86_64 -c ../lib/libtcc1.c - @./tcc -O2 -B. -m64 -DTCC_TARGET_PE -DTCC_TARGET_X86_64 -c ../lib/alloca86_64.S - @./tcc -O2 -B. -m64 -DTCC_TARGET_PE -DTCC_TARGET_X86_64 -c ../lib/alloca86_64-bt.S - @./tcc -O2 -B. -m64 -DTCC_TARGET_PE -DTCC_TARGET_X86_64 -c lib/crt1.c - @./tcc -O2 -B. -m64 -DTCC_TARGET_PE -DTCC_TARGET_X86_64 -c lib/crt1w.c - @./tcc -O2 -B. -m64 -DTCC_TARGET_PE -DTCC_TARGET_X86_64 -c lib/wincrt1.c - @./tcc -O2 -B. -m64 -DTCC_TARGET_PE -DTCC_TARGET_X86_64 -c lib/wincrt1w.c - @./tcc -O2 -B. -m64 -DTCC_TARGET_PE -DTCC_TARGET_X86_64 -c lib/dllcrt1.c - @./tcc -O2 -B. -m64 -DTCC_TARGET_PE -DTCC_TARGET_X86_64 -c lib/dllmain.c - @./tcc -O2 -B. -m64 -DTCC_TARGET_PE -DTCC_TARGET_X86_64 -c lib/chkstk.S - @./tcc -m64 -ar lib/libtcc1-64.a libtcc1.o alloca86_64.o alloca86_64-bt.o crt1.o wincrt1.o crt1w.o wincrt1w.o dllcrt1.o dllmain.o chkstk.o - @rm *.o - -libs: lib/libtcc1-32.a lib/libtcc1-64.a - -PHONY += libs - -rebuild: - @echo Rebuild using tcc itself - default $(TARGET)bits - @./$(TARCH)-win32-tcc -O2 -B. $(TFLAGS) -DTCC_TARGET_PE -o tcc.exe ../tcc.c - @./tcc -O2 -B. $(TFLAGS) -DTCC_TARGET_PE -DLIBTCC_AS_DLL -o libtcc.dll -shared ../libtcc.c - @./tcc -O2 -B. -m32 -DTCC_TARGET_PE -DTCC_TARGET_I386 -o tmp-tcc.exe ../tcc.c && mv tmp-tcc.exe i386-win32-tcc.exe - @./tcc -O2 -B. -m$(TARGET) -DTCC_TARGET_PE -DTCC_TARGET_X86_64 -o tmp-tcc.exe ../tcc.c && mv tmp-tcc.exe x86_64-win32-tcc.exe - -PHONY += rebuild - -test: - @(cd ../tests; $(MAKE) -k TCC=$(PWD)/tcc hello-exe hello-run) - @(cd ../tests; $(MAKE) -k TCC=$(PWD)/tcc vla_test-run tests2-dir pp-dir) -ifeq ($(CPU), 64) - @(cd ../tests; $(MAKE) -k TCC=$(PWD)/i386-win32-tcc hello-exe hello-run) - @(cd ../tests; $(MAKE) -k TCC=$(PWD)/i386-win32-tcc vla_test-run tests2-dir pp-dir) -endif - -PHONY += test - -TARNAME = tcc-$(VERSION)-$(ARCH)-win32 - -tarball: - @rm -r -f $(TARNAME) - @mkdir $(TARNAME) - @cp -r doc $(TARNAME) - @cp -r examples $(TARNAME) - @cp -r include $(TARNAME) - @cp -r lib $(TARNAME) - @cp -r libtcc $(TARNAME) - @cp -r build-tcc.bat $(TARNAME) - @cp -r i386-win32-tcc.exe $(TARNAME) - @cp -r libtcc.def $(TARNAME) - @cp -r libtcc.dll $(TARNAME) - @cp -r Makefile $(TARNAME) - @cp -r tcc.exe $(TARNAME) - @cp -r tcc-win32.txt $(TARNAME) - @cp -r x86_64-win32-tcc.exe $(TARNAME) - @tar czf $(TARNAME).tar.gz $(TARNAME) - @rm -r -f $(TARNAME) - -PHONY += tarball - -clean: - rm -f *.o *.exe *.dll lib/*.a *.pdb *.obj *.exp *.def *.lib |
