2007-11-26 01:14:35 +03:00
|
|
|
@rem ----------------------------------------------------
|
2012-12-21 00:20:54 +04:00
|
|
|
@rem batch file to build tcc using mingw gcc
|
2007-11-26 01:14:35 +03:00
|
|
|
@rem ----------------------------------------------------
|
2009-07-19 00:06:46 +04:00
|
|
|
|
2012-12-21 00:20:54 +04:00
|
|
|
@set /p VERSION= < ..\VERSION
|
|
|
|
echo>..\config.h #define TCC_VERSION "%VERSION%"
|
2009-07-19 00:06:46 +04:00
|
|
|
|
|
|
|
@if _%PROCESSOR_ARCHITEW6432%_==_AMD64_ goto x86_64
|
|
|
|
@if _%PROCESSOR_ARCHITECTURE%_==_AMD64_ goto x86_64
|
2010-12-04 18:47:08 +03:00
|
|
|
|
|
|
|
@set target=-DTCC_TARGET_PE -DTCC_TARGET_I386
|
2011-08-10 14:42:14 +04:00
|
|
|
@set CC=gcc -Os -s -fno-strict-aliasing
|
2010-12-04 18:47:08 +03:00
|
|
|
@set P=32
|
2009-07-19 00:06:46 +04:00
|
|
|
@goto tools
|
|
|
|
|
|
|
|
:x86_64
|
2010-11-26 22:45:10 +03:00
|
|
|
@set target=-DTCC_TARGET_PE -DTCC_TARGET_X86_64
|
2010-12-04 18:47:08 +03:00
|
|
|
@rem mingw 64 has an ICE with -Os
|
2011-08-10 14:42:14 +04:00
|
|
|
@set CC=x86_64-pc-mingw32-gcc -O0 -s -fno-strict-aliasing
|
2010-12-04 18:47:08 +03:00
|
|
|
@set P=64
|
2012-12-21 00:20:54 +04:00
|
|
|
@goto tools
|
2009-07-19 00:06:46 +04:00
|
|
|
|
|
|
|
:tools
|
2010-12-04 18:47:08 +03:00
|
|
|
%CC% %target% tools/tiny_impdef.c -o tiny_impdef.exe
|
|
|
|
%CC% %target% tools/tiny_libmaker.c -o tiny_libmaker.exe
|
2009-07-19 00:06:46 +04:00
|
|
|
|
|
|
|
:libtcc
|
|
|
|
if not exist libtcc\nul mkdir libtcc
|
|
|
|
copy ..\libtcc.h libtcc\libtcc.h
|
2012-04-18 20:38:11 +04:00
|
|
|
%CC% %target% -shared -DLIBTCC_AS_DLL -DONE_SOURCE ../libtcc.c -o libtcc.dll -Wl,-out-implib,libtcc/libtcc.a
|
2012-12-21 00:20:54 +04:00
|
|
|
tiny_impdef libtcc.dll -o libtcc/libtcc.def
|
2009-07-19 00:06:46 +04:00
|
|
|
|
|
|
|
:tcc
|
2012-04-18 20:32:37 +04:00
|
|
|
%CC% %target% ../tcc.c -o tcc.exe -ltcc -Llibtcc
|
2009-07-19 00:06:46 +04:00
|
|
|
|
2009-12-20 00:22:43 +03:00
|
|
|
:copy_std_includes
|
2009-12-20 00:08:37 +03:00
|
|
|
copy ..\include\*.h include
|
2009-12-20 00:22:43 +03:00
|
|
|
|
|
|
|
:libtcc1.a
|
2010-12-04 18:47:08 +03:00
|
|
|
.\tcc %target% -c ../lib/libtcc1.c
|
2010-11-26 22:45:10 +03:00
|
|
|
.\tcc %target% -c lib/crt1.c
|
|
|
|
.\tcc %target% -c lib/wincrt1.c
|
|
|
|
.\tcc %target% -c lib/dllcrt1.c
|
|
|
|
.\tcc %target% -c lib/dllmain.c
|
|
|
|
.\tcc %target% -c lib/chkstk.S
|
2012-12-21 00:20:54 +04:00
|
|
|
goto lib%P%
|
2009-12-20 00:22:43 +03:00
|
|
|
|
2010-12-04 18:47:08 +03:00
|
|
|
:lib32
|
|
|
|
.\tcc %target% -c ../lib/alloca86.S
|
|
|
|
.\tcc %target% -c ../lib/alloca86-bt.S
|
2010-11-26 22:45:10 +03:00
|
|
|
.\tcc %target% -c ../lib/bcheck.c
|
2010-12-04 18:47:08 +03:00
|
|
|
tiny_libmaker lib/libtcc1.a libtcc1.o alloca86.o alloca86-bt.o crt1.o wincrt1.o dllcrt1.o dllmain.o chkstk.o bcheck.o
|
|
|
|
@goto the_end
|
2009-12-20 00:22:43 +03:00
|
|
|
|
2010-12-04 18:47:08 +03:00
|
|
|
:lib64
|
|
|
|
.\tcc %target% -c ../lib/alloca86_64.S
|
|
|
|
tiny_libmaker lib/libtcc1.a libtcc1.o alloca86_64.o crt1.o wincrt1.o dllcrt1.o dllmain.o chkstk.o
|
2009-12-20 00:22:43 +03:00
|
|
|
|
2010-12-04 18:47:08 +03:00
|
|
|
:the_end
|
2007-11-26 01:14:35 +03:00
|
|
|
del *.o
|