64bit: Fix addends > 32 bits
[tinycc.git] / win32 / build-tcc.bat
blobc795c19ff4c1a3947782675dd64721eb894bedb7
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
13 @set P=32
14 @goto tools
16 :x86_64
17 @set target=-DTCC_TARGET_PE -DTCC_TARGET_X86_64
18 @set CC=gcc -m64 -Os -s -fno-strict-aliasing
19 @set P=64
20 @goto tools
22 :tools
23 %CC% %target% tools/tiny_impdef.c -o tiny_impdef.exe
24 %CC% %target% tools/tiny_libmaker.c -o tiny_libmaker.exe
26 :libtcc
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
32 :tcc
33 %CC% %target% ../tcc.c -o tcc.exe -ltcc -Llibtcc
35 :copy_std_includes
36 copy ..\include\*.h include
37 copy ..\tcclib.h include
38 copy ..\tests\libtcc_test.c examples
40 :libtcc1.a
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
47 goto lib%P%
49 :lib32
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
54 @goto the_end
56 :lib64
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
60 :the_end
61 del *.o
63 :makedoc
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 ***