History

win64: add x64 target to build-tcc.bat

grischka committed 17 years ago

Commit c0fc0fa1 parent dc251a71 file · +47 −19Browse files

Unified · Split

win32/build-tcc.bat+47−19
@@ -1,28 +1,56 @@
11 @rem ----------------------------------------------------
22 @rem batch file to build tcc using gcc and ar from mingw
33 @rem ----------------------------------------------------
4−:
5−@echo>..\config.h #define TCC_VERSION "0.9.25"
6−@echo>>..\config.h #define TCC_TARGET_PE 1
7−@echo>>..\config.h #define CONFIG_TCCDIR "."
8−@echo>>..\config.h #define CONFIG_SYSROOT ""
9−:
10−gcc -Os -fno-strict-aliasing ../tcc.c -o tcc.exe -s
11−gcc -Os -fno-strict-aliasing ../libtcc.c -c -o libtcc.o
12−gcc -Os tools/tiny_impdef.c -o tiny_impdef.exe -s
13−gcc -Os tools/tiny_libmaker.c -o tiny_libmaker.exe -s
14−mkdir libtcc
15−ar rcs libtcc/libtcc.a libtcc.o
16−del libtcc.o
17−copy ..\libtcc.h libtcc
18−:
4+@set PROMPT=$G$S
5+
6+copy ..\include\*.h include
7+
8+echo>..\config.h #define TCC_VERSION "0.9.25"
9+echo>>..\config.h #define TCC_TARGET_PE 1
10+echo>>..\config.h #define CONFIG_TCCDIR "."
11+echo>>..\config.h #define CONFIG_SYSROOT ""
12+
13+@if _%PROCESSOR_ARCHITEW6432%_==_AMD64_ goto x86_64
14+@if _%PROCESSOR_ARCHITECTURE%_==_AMD64_ goto x86_64
15+
16+:i386
17+@set AS=.\tcc -c
18+@goto tools
19+
20+:x86_64
21+@set P=x86_64-pc-mingw32-
22+@set X64=-x64
23+@rem !!! currently TinyCC doesn't 64bit asm. Need 'yasm' !!!
24+@set AS=yasm -p gnu -f elf64
25+echo>>..\config.h #define TCC_TARGET_X86_64 1
26+@goto tools
27+
28+:tools
29+%P%gcc -Os tools/tiny_impdef.c -o tiny_impdef.exe -s
30+%P%gcc -Os tools/tiny_libmaker.c -o tiny_libmaker.exe -s
31+
32+:libtcc
33+if not exist libtcc\nul mkdir libtcc
34+copy ..\libtcc.h libtcc\libtcc.h
35+
36+%P%gcc -Os -fno-strict-aliasing ../libtcc.c -c -o libtcc.o
37+%P%ar rcs libtcc/libtcc.a libtcc.o
38+
39+:tcc
40+%P%gcc -Os -fno-strict-aliasing ../tcc.c -o tcc.exe -s -DTCC_USE_LIBTCC -ltcc -Llibtcc
41+
42+:libtcc1.a
1943 .\tcc -c lib/crt1.c
2044 .\tcc -c lib/wincrt1.c
2145 .\tcc -c lib/dllcrt1.c
2246 .\tcc -c lib/dllmain.c
23−.\tcc -c lib/chkstk.S
2447 .\tcc -c ../lib/libtcc1.c
25−.\tcc -c ../lib/alloca86.S
26−.\tcc -c ../lib/alloca86-bt.S
27−ar rcs lib/libtcc1.a crt1.o wincrt1.o dllcrt1.o dllmain.o chkstk.o libtcc1.o alloca86.o alloca86-bt.o
48+.\tcc -o tmp.s -E lib/chkstk.S
49+%AS% -o chkstk.o tmp.s
50+.\tcc -o tmp.s -E ../lib/alloca86.S
51+%AS% -o alloca86.o tmp.s
52+del tmp.s
53+tiny_libmaker lib/libtcc1%X64%.a crt1.o wincrt1.o dllcrt1.o dllmain.o chkstk.o libtcc1.o alloca86.o
54+
55+:cleanup
2856 del *.o

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