1 @rem ----------------------------------------------------
2 @rem batch file to build tcc using mingw gcc
3 @rem ----------------------------------------------------
5 @set /p VERSION= < ..\VERSION
6 echo>..\config.h #define TCC_VERSION "%VERSION%"
8 @if _%PROCESSOR_ARCHITECTURE%_==_AMD64_ goto x86_64
9 @if _%PROCESSOR_ARCHITEW6432%_==_AMD64_ goto x86_64
11 @set target=-DTCC_TARGET_PE -DTCC_TARGET_I386
12 @set CC=gcc -m32 -Os -s -fno-strict-aliasing
17 @set target=-DTCC_TARGET_PE -DTCC_TARGET_X86_64
18 @set CC=gcc -m64 -Os -s -fno-strict-aliasing
23 %CC% %target% tools/tiny_impdef.c -o tiny_impdef.exe
24 %CC% %target% tools/tiny_libmaker.c -o tiny_libmaker.exe
27 if not exist libtcc mkdir libtcc
28 copy ..\libtcc.h libtcc\libtcc.h
29 %CC% %target% -shared -DLIBTCC_AS_DLL -DONE_SOURCE ../libtcc.c -o libtcc.dll -Wl,-out-implib,libtcc/libtcc.a
30 tiny_impdef libtcc.dll -o libtcc/libtcc.def
33 %CC% %target% ../tcc.c -o tcc.exe -ltcc -Llibtcc
36 copy ..\include\*.h include
37 copy ..\tcclib.h include
38 copy ..\tests\libtcc_test.c examples
41 .\tcc %target% -c ../lib/libtcc1.c
42 .\tcc %target% -c lib/crt1.c
43 .\tcc %target% -c lib/wincrt1.c
44 .\tcc %target% -c lib/dllcrt1.c
45 .\tcc %target% -c lib/dllmain.c
46 .\tcc %target% -c lib/chkstk.S
50 .\tcc %target% -c ../lib/alloca86.S
51 .\tcc %target% -c ../lib/alloca86-bt.S
52 .\tcc %target% -c ../lib/bcheck.c
53 tiny_libmaker lib/libtcc1.a libtcc1.o alloca86.o alloca86-bt.o crt1.o wincrt1.o dllcrt1.o dllmain.o chkstk.o bcheck.o
57 .\tcc %target% -c ../lib/alloca86_64.S
58 tiny_libmaker lib/libtcc1.a libtcc1.o alloca86_64.o crt1.o wincrt1.o dllcrt1.o dllmain.o chkstk.o
64 if not exist doc md doc
65 copy tcc-win32.txt doc
66 echo>..\config.texi @set VERSION %VERSION%
67 makeinfo --html --no-split -o doc\tcc-doc.html ../tcc-doc.texi || echo *** tcc-doc.html was not built ***