tccelf: fix warning
[tinycc.git] / win32 / build-tcc.bat
blobcb2721ae5d2051668c9eb656f9ce5eabfd722d7c
1 @rem ----------------------------------------------------
2 @rem batch file to build tcc using gcc and ar from mingw
3 @rem ----------------------------------------------------
4 @set PROMPT=$G$S
6 echo>..\config.h #define TCC_VERSION "0.9.25"
7 echo>>..\config.h #define TCC_TARGET_PE 1
8 echo>>..\config.h #define CONFIG_TCCDIR "."
9 echo>>..\config.h #define CONFIG_SYSROOT ""
11 @if _%PROCESSOR_ARCHITEW6432%_==_AMD64_ goto x86_64
12 @if _%PROCESSOR_ARCHITECTURE%_==_AMD64_ goto x86_64
13 @goto tools
15 :x86_64
16 echo>>..\config.h #define TCC_TARGET_X86_64 1
17 @set P=x86_64-pc-mingw32-
18 @set S=_64
19 @goto tools
21 :tools
22 %P%gcc -Os tools/tiny_impdef.c -o tiny_impdef.exe -s
23 %P%gcc -Os tools/tiny_libmaker.c -o tiny_libmaker.exe -s
25 :libtcc
26 if not exist libtcc\nul mkdir libtcc
27 copy ..\libtcc.h libtcc\libtcc.h
28 %P%gcc -Os -fno-strict-aliasing ../libtcc.c -c -o libtcc.o
29 %P%ar rcs libtcc/libtcc.a libtcc.o
31 :tcc
32 %P%gcc -Os -fno-strict-aliasing ../tcc.c -o tcc.exe -s -DTCC_USE_LIBTCC -ltcc -Llibtcc
34 :copy_std_includes
35 copy ..\include\*.h include
37 :libtcc1.a
38 .\tcc -c lib/crt1.c
39 .\tcc -c lib/wincrt1.c
40 .\tcc -c lib/dllcrt1.c
41 .\tcc -c lib/dllmain.c
42 .\tcc -c ../lib/libtcc1.c
43 .\tcc -c lib/chkstk.S
44 .\tcc -c ../lib/alloca86%S%.S
46 @set LIBFILES=crt1.o wincrt1.o dllcrt1.o dllmain.o chkstk.o libtcc1.o alloca86%S%.o
48 @if not _%P%==_ goto makelib
49 .\tcc -c ../lib/alloca86-bt%S%.S
50 .\tcc -c ../lib/bcheck.c
52 @set LIBFILES=%LIBFILES% alloca86-bt%S%.o bcheck.o
54 :makelib
55 tiny_libmaker lib/libtcc1.a %LIBFILES%
56 del *.o