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
1@rem ----------------------------------------------------2@rem ----------------------------------------------------
2@rem batch file to build tcc using mingw gcc3@rem batch file to build tcc using mingw gcc
3@rem ----------------------------------------------------4@rem ----------------------------------------------------
@@ -5,28 +6,30 @@ · 1 unmodified line
5@set /p VERSION= < ..\VERSION6@set /p VERSION= < ..\VERSION
6echo>..\config.h #define TCC_VERSION "%VERSION%"7echo>..\config.h #define TCC_VERSION "%VERSION%"
7 8
8@rem @if _%PROCESSOR_ARCHITEW6432%_==_AMD64_ goto x86_649@if _%1_==_AMD64_ shift /1 && goto x86_64
9@if _%PROCESSOR_ARCHITECTURE%_==_AMD64_ goto x86_6410@if _%1_==_x64_ shift /1 && goto x86_64
10 11
11@set target=-DTCC_TARGET_PE -DTCC_TARGET_I38612@set target=-DTCC_TARGET_PE -DTCC_TARGET_I386
12@set CC=gcc -Os -s -fno-strict-aliasing13@set CC=gcc -Os -s -fno-strict-aliasing
14@if _%1_==_debug_ set CC=gcc -g -ggdb
13@set P=3215@set P=32
14@goto tools16@goto tools
15 17
16:x86_6418:x86_64
17@set target=-DTCC_TARGET_PE -DTCC_TARGET_X86_6419@set target=-DTCC_TARGET_PE -DTCC_TARGET_X86_64
18@rem mingw 64 has an ICE with -Os20@set CC=x86_64-w64-mingw32-gcc -Os -s -fno-strict-aliasing
19@set CC=x86_64-pc-mingw32-gcc -O0 -s -fno-strict-aliasing21@if _%1_==_debug_ set CC=x86_64-w64-mingw32-gcc -g -ggdb
20@set P=6422@set P=64
21@goto tools23@goto tools
22 24
23:tools25:tools
26echo will use %CC% %target%
24%CC% %target% tools/tiny_impdef.c -o tiny_impdef.exe27%CC% %target% tools/tiny_impdef.c -o tiny_impdef.exe
25%CC% %target% tools/tiny_libmaker.c -o tiny_libmaker.exe28%CC% %target% tools/tiny_libmaker.c -o tiny_libmaker.exe
26 29
27:libtcc30:libtcc
28if not exist libtcc mkdir libtcc31if not exist libtcc mkdir libtcc
29copy ..\libtcc.h libtcc\libtcc.h32copy ..\libtcc.h libtcc\libtcc.h > nul
30%CC% %target% -shared -DLIBTCC_AS_DLL -DONE_SOURCE ../libtcc.c -o libtcc.dll -Wl,-out-implib,libtcc/libtcc.a33%CC% %target% -shared -DLIBTCC_AS_DLL -DONE_SOURCE ../libtcc.c -o libtcc.dll -Wl,-out-implib,libtcc/libtcc.a
31tiny_impdef libtcc.dll -o libtcc/libtcc.def34tiny_impdef libtcc.dll -o libtcc/libtcc.def
32 35
@@ -34,7 +37,7 @@ tiny_impdef libtcc.dll -o libtcc/libtcc.def · 1 unmodified line
34%CC% %target% ../tcc.c -o tcc.exe -ltcc -Llibtcc37%CC% %target% ../tcc.c -o tcc.exe -ltcc -Llibtcc
35 38
36:copy_std_includes39:copy_std_includes
37copy ..\include\*.h include40copy ..\include\*.h include > nul
38 41
39:libtcc1.a42:libtcc1.a
40.\tcc %target% -c ../lib/libtcc1.c43.\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
60del *.o63del *.o
61 64
62:makedoc65:makedoc
66where makeinfo > nul 2>&1 || goto :skip_makedoc
63echo>..\config.texi @set VERSION %VERSION%67echo>..\config.texi @set VERSION %VERSION%
64if not exist doc md doc68if not exist doc md doc
65makeinfo --html --no-split -o doc\tcc-doc.html ../tcc-doc.texi69makeinfo --html --no-split -o doc\tcc-doc.html ../tcc-doc.texi
66copy tcc-win32.txt doc70copy tcc-win32.txt doc
67copy ..\tests\libtcc_test.c examples71copy ..\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