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 @rem @if _%PROCESSOR_ARCHITEW6432%_==_AMD64_ goto x86_64
9 @if _%PROCESSOR_ARCHITECTURE%_==_AMD64_ goto x86_64
11 @set target=-DTCC_TARGET_PE -DTCC_TARGET_I386
12 @set CC=gcc -Os -s -fno-strict-aliasing
17 @set target=-DTCC_TARGET_PE -DTCC_TARGET_X86_64
18 @rem mingw 64 has an ICE with -Os
19 @set CC=x86_64-pc-mingw32-gcc -O0 -s -fno-strict-aliasing
24 %CC% %target% tools/tiny_impdef.c -o tiny_impdef.exe
25 %CC% %target% tools/tiny_libmaker.c -o tiny_libmaker.exe
28 if not exist libtcc mkdir libtcc
29 copy ..\libtcc.h libtcc\libtcc.h
30 %CC% %target% -shared -DLIBTCC_AS_DLL -DONE_SOURCE ../libtcc.c -o libtcc.dll -Wl,-out-implib,libtcc/libtcc.a
31 tiny_impdef libtcc.dll -o libtcc/libtcc.def
34 %CC% %target% ../tcc.c -o tcc.exe -ltcc -Llibtcc
37 copy ..\include\*.h include
40 .\tcc %target% -c ../lib/libtcc1.c
41 .\tcc %target% -c lib/crt1.c
42 .\tcc %target% -c lib/wincrt1.c
43 .\tcc %target% -c lib/dllcrt1.c
44 .\tcc %target% -c lib/dllmain.c
45 .\tcc %target% -c lib/chkstk.S
49 .\tcc %target% -c ../lib/alloca86.S
50 .\tcc %target% -c ../lib/alloca86-bt.S
51 .\tcc %target% -c ../lib/bcheck.c
52 tiny_libmaker lib/libtcc1.a libtcc1.o alloca86.o alloca86-bt.o crt1.o wincrt1.o dllcrt1.o dllmain.o chkstk.o bcheck.o
56 .\tcc %target% -c ../lib/alloca86_64.S
57 tiny_libmaker lib/libtcc1.a libtcc1.o alloca86_64.o crt1.o wincrt1.o dllcrt1.o dllmain.o chkstk.o
63 echo>..\config.texi @set VERSION %VERSION%
64 if not exist doc md doc
65 makeinfo --html --no-split -o doc\tcc-doc.html ../tcc-doc.texi
66 copy tcc-win32.txt doc
67 copy ..\tests\libtcc_test.c examples