win32: build-tcc.bat: get rid of hardcoded VERSION string

Also:
 - put libtcc.def into libtcc dir
 - remove ar references
 - remove libtcc_test from build
master
grischka 2012-12-20 21:20:54 +01:00
parent 3f09b90d21
commit b174399340
2 changed files with 7 additions and 11 deletions

View File

@ -1,15 +1,15 @@
@rem ----------------------------------------------------
@rem batch file to build tcc using gcc and ar from mingw
@rem batch file to build tcc using mingw gcc
@rem ----------------------------------------------------
echo>..\config.h #define TCC_VERSION "0.9.25"
@set /p VERSION= < ..\VERSION
echo>..\config.h #define TCC_VERSION "%VERSION%"
@if _%PROCESSOR_ARCHITEW6432%_==_AMD64_ goto x86_64
@if _%PROCESSOR_ARCHITECTURE%_==_AMD64_ goto x86_64
@set target=-DTCC_TARGET_PE -DTCC_TARGET_I386
@set CC=gcc -Os -s -fno-strict-aliasing
@set AR=ar
@set P=32
@goto tools
@ -17,8 +17,8 @@ echo>..\config.h #define TCC_VERSION "0.9.25"
@set target=-DTCC_TARGET_PE -DTCC_TARGET_X86_64
@rem mingw 64 has an ICE with -Os
@set CC=x86_64-pc-mingw32-gcc -O0 -s -fno-strict-aliasing
@set AR=x86_64-pc-mingw32-ar
@set P=64
@goto tools
:tools
%CC% %target% tools/tiny_impdef.c -o tiny_impdef.exe
@ -28,7 +28,7 @@ echo>..\config.h #define TCC_VERSION "0.9.25"
if not exist libtcc\nul mkdir libtcc
copy ..\libtcc.h libtcc\libtcc.h
%CC% %target% -shared -DLIBTCC_AS_DLL -DONE_SOURCE ../libtcc.c -o libtcc.dll -Wl,-out-implib,libtcc/libtcc.a
tiny_impdef libtcc.dll -o lib/libtcc.def
tiny_impdef libtcc.dll -o libtcc/libtcc.def
:tcc
%CC% %target% ../tcc.c -o tcc.exe -ltcc -Llibtcc
@ -43,7 +43,7 @@ copy ..\include\*.h include
.\tcc %target% -c lib/dllcrt1.c
.\tcc %target% -c lib/dllmain.c
.\tcc %target% -c lib/chkstk.S
@if _%P%_==_64_ goto lib64
goto lib%P%
:lib32
.\tcc %target% -c ../lib/alloca86.S
@ -58,7 +58,3 @@ tiny_libmaker lib/libtcc1.a libtcc1.o alloca86_64.o crt1.o wincrt1.o dllcrt1.o d
:the_end
del *.o
:libtcc_test
.\tcc -v -I libtcc -ltcc ../tests/libtcc_test.c
.\libtcc_test

View File

@ -64,7 +64,7 @@
For the 'libtcc_test' example type
tcc examples/libtcc_test.c -I libtcc -ltcc
tcc examples/libtcc_test.c -I libtcc -L libtcc -ltcc
Import Definition Files: