x86-64: fix flags and zero-pad long doubles
[tinycc.git] / win32 / build-tcc.bat
blob3b2bb1e18ec3d3432158c72bf5c01d3aff03ec2b
1 @rem ----------------------------------------------------
2 @rem batch file to build tcc using gcc and ar from mingw
3 @rem ----------------------------------------------------
5 echo>..\config.h #define TCC_VERSION "0.9.25"
6 echo>>..\config.h #define CONFIG_TCCDIR "."
7 echo>>..\config.h #define CONFIG_SYSROOT ""
9 @if _%PROCESSOR_ARCHITEW6432%_==_AMD64_ goto x86_64
10 @if _%PROCESSOR_ARCHITECTURE%_==_AMD64_ goto x86_64
12 @set target=-DTCC_TARGET_PE -DTCC_TARGET_I386
13 @set CC=gcc -Os -s
14 @set AR=ar
15 @set P=32
16 @goto tools
18 :x86_64
19 @set target=-DTCC_TARGET_PE -DTCC_TARGET_X86_64
20 @rem mingw 64 has an ICE with -Os
21 @set CC=x86_64-pc-mingw32-gcc -O0 -s
22 @set AR=x86_64-pc-mingw32-ar
23 @set P=64
25 :tools
26 %CC% %target% tools/tiny_impdef.c -o tiny_impdef.exe
27 %CC% %target% tools/tiny_libmaker.c -o tiny_libmaker.exe
29 :libtcc
30 if not exist libtcc\nul mkdir libtcc
31 copy ..\libtcc.h libtcc\libtcc.h
32 %CC% %target% -fno-strict-aliasing -DONE_SOURCE ../libtcc.c -c -o libtcc.o
33 %AR% rcs libtcc/libtcc.a libtcc.o
35 :tcc
36 %CC% %target% -fno-strict-aliasing ../tcc.c -o tcc.exe -ltcc -Llibtcc
38 :copy_std_includes
39 copy ..\include\*.h include
41 :libtcc1.a
42 .\tcc %target% -c ../lib/libtcc1.c
43 .\tcc %target% -c lib/crt1.c
44 .\tcc %target% -c lib/wincrt1.c
45 .\tcc %target% -c lib/dllcrt1.c
46 .\tcc %target% -c lib/dllmain.c
47 .\tcc %target% -c lib/chkstk.S
48 @if _%P%_==_64_ goto lib64
50 :lib32
51 .\tcc %target% -c ../lib/alloca86.S
52 .\tcc %target% -c ../lib/alloca86-bt.S
53 .\tcc %target% -c ../lib/bcheck.c
54 tiny_libmaker lib/libtcc1.a libtcc1.o alloca86.o alloca86-bt.o crt1.o wincrt1.o dllcrt1.o dllmain.o chkstk.o bcheck.o
55 @goto the_end
57 :lib64
58 .\tcc %target% -c ../lib/alloca86_64.S
59 tiny_libmaker lib/libtcc1.a libtcc1.o alloca86_64.o crt1.o wincrt1.o dllcrt1.o dllmain.o chkstk.o
61 :the_end
62 del *.o