aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--win32/build-tcc.bat24
1 files changed, 13 insertions, 11 deletions
diff --git a/win32/build-tcc.bat b/win32/build-tcc.bat
index bcab233..de042a8 100644
--- a/win32/build-tcc.bat
+++ b/win32/build-tcc.bat
@@ -12,17 +12,11 @@ echo>>..\config.h #define CONFIG_SYSROOT ""
@if _%PROCESSOR_ARCHITEW6432%_==_AMD64_ goto x86_64
@if _%PROCESSOR_ARCHITECTURE%_==_AMD64_ goto x86_64
-
-:i386
-@set AS=.\tcc -c
@goto tools
:x86_64
-@set P=x86_64-pc-mingw32-
-@set X64=-x64
-@rem !!! currently TinyCC doesn't 64bit asm. Need 'yasm' !!!
-@set AS=yasm -p gnu -f elf64
echo>>..\config.h #define TCC_TARGET_X86_64 1
+@set P=x86_64-pc-mingw32-
@goto tools
:tools
@@ -45,12 +39,20 @@ copy ..\libtcc.h libtcc\libtcc.h
.\tcc -c lib/dllcrt1.c
.\tcc -c lib/dllmain.c
.\tcc -c ../lib/libtcc1.c
+@if not x%P%==x goto asm64
+.\tcc -c lib/chkstk.S
+.\tcc -c ../lib/alloca86.S
+tiny_libmaker lib/libtcc1.a crt1.o wincrt1.o dllcrt1.o dllmain.o chkstk.o libtcc1.o alloca86.o
+@goto cleanup
+
+:asm64
+@rem !!! currently TinyCC doesn't 64bit asm. Need 'yasm' !!!
.\tcc -o tmp.s -E lib/chkstk.S
-%AS% -o chkstk.o tmp.s
-.\tcc -o tmp.s -E ../lib/alloca86.S
-%AS% -o alloca86.o tmp.s
+yasm -p gnu -f elf64 -o chkstk.o tmp.s
+.\tcc -o tmp.s -E ../lib/alloca86_64.S
+yasm -p gnu -f elf64 -o alloca86_64.o tmp.s
del tmp.s
-tiny_libmaker lib/libtcc1%X64%.a crt1.o wincrt1.o dllcrt1.o dllmain.o chkstk.o libtcc1.o alloca86.o
+tiny_libmaker lib/libtcc1.a crt1.o wincrt1.o dllcrt1.o dllmain.o chkstk.o libtcc1.o alloca86_64.o
:cleanup
del *.o