History

Win32 build script handles `x64` and `debug` params

Vlad Vissoultchev committed 10 years ago

Commit 2dc71611 parent 8e4d64b1 file · +11 −6Browse files

Unified · Split

win32/build-tcc.bat+11−6
@@ -1,3 +1,4 @@
1+@echo off
12 @rem ----------------------------------------------------
23 @rem batch file to build tcc using mingw gcc
34 @rem ----------------------------------------------------
@@ -5,28 +6,30 @@ · 1 unmodified line
56 @set /p VERSION= < ..\VERSION
67 echo>..\config.h #define TCC_VERSION "%VERSION%"
78
8−@rem @if _%PROCESSOR_ARCHITEW6432%_==_AMD64_ goto x86_64
9−@if _%PROCESSOR_ARCHITECTURE%_==_AMD64_ goto x86_64
9+@if _%1_==_AMD64_ shift /1 && goto x86_64
10+@if _%1_==_x64_ shift /1 && goto x86_64
1011
1112 @set target=-DTCC_TARGET_PE -DTCC_TARGET_I386
1213 @set CC=gcc -Os -s -fno-strict-aliasing
14+@if _%1_==_debug_ set CC=gcc -g -ggdb
1315 @set P=32
1416 @goto tools
1517
1618 :x86_64
1719 @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
20+@set CC=x86_64-w64-mingw32-gcc -Os -s -fno-strict-aliasing
21+@if _%1_==_debug_ set CC=x86_64-w64-mingw32-gcc -g -ggdb
2022 @set P=64
2123 @goto tools
2224
2325 :tools
26+echo will use %CC% %target%
2427 %CC% %target% tools/tiny_impdef.c -o tiny_impdef.exe
2528 %CC% %target% tools/tiny_libmaker.c -o tiny_libmaker.exe
2629
2730 :libtcc
2831 if not exist libtcc mkdir libtcc
29−copy ..\libtcc.h libtcc\libtcc.h
32+copy ..\libtcc.h libtcc\libtcc.h > nul
3033 %CC% %target% -shared -DLIBTCC_AS_DLL -DONE_SOURCE ../libtcc.c -o libtcc.dll -Wl,-out-implib,libtcc/libtcc.a
3134 tiny_impdef libtcc.dll -o libtcc/libtcc.def
3235
@@ -34,7 +37,7 @@ tiny_impdef libtcc.dll -o libtcc/libtcc.def · 1 unmodified line
3437 %CC% %target% ../tcc.c -o tcc.exe -ltcc -Llibtcc
3538
3639 :copy_std_includes
37−copy ..\include\*.h include
40+copy ..\include\*.h include > nul
3841
3942 :libtcc1.a
4043 .\tcc %target% -c ../lib/libtcc1.c
@@ -60,8 +63,10 @@ tiny_libmaker lib/libtcc1.a libtcc1.o alloca86_64.o crt1.o wincrt1.o dllcrt1.o d · 19 unmodified lines
6063 del *.o
6164
6265 :makedoc
66+where makeinfo > nul 2>&1 || goto :skip_makedoc
6367 echo>..\config.texi @set VERSION %VERSION%
6468 if not exist doc md doc
6569 makeinfo --html --no-split -o doc\tcc-doc.html ../tcc-doc.texi
6670 copy tcc-win32.txt doc
6771 copy ..\tests\libtcc_test.c examples
72+:skip_makedoc

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t