File: BUILDVC.BAT

package info (click to toggle)
python-bumps 0.7.11-2
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 10,264 kB
  • sloc: python: 22,226; ansic: 4,973; cpp: 4,849; xml: 493; makefile: 163; perl: 108; sh: 101
file content (50 lines) | stat: -rw-r--r-- 1,669 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
:: Call this with either x86 (for 32bit compile on a 32bit machine),
:: amd64 (if you want to do a 64bit compile on a 64bit machine),
:: or x86_amd64 (if you want to compile for amd64 on an x86)
:: With no argument, will default to amd64 on Win64 and x86 otherwise.
:: Call this with the argument "run" if you want to only run the 
:: previously compiled executables.
@echo off
setlocal
if not "%1"=="run" goto :Default
set CC=echo
set CFLAGS=
goto :Loop

:Default
if "%~1"=="" goto :Guess
set NEWBUILDVC=%1
goto :Next

:Guess
set RegQry=HKLM\Hardware\Description\System\CentralProcessor\0
REG.exe Query %RegQry% > hwdesc.o
FIND /i "x86" < hwdesc.o > hwcheck.o
if %errorlevel% == 0 (
set NEWBUILDVC=x86
) else (
set NEWBUILDVC=amd64
)

:Next
if "%BUILDVC%"=="%NEWBUILDVC%" goto :Continue
if NOT DEFINED VCBAT set VCBAT="c:\Program Files (x86)\Microsoft Visual Studio 10.0\vc\vcvarsall.bat"
call %VCBAT% %NEWBUILDVC%
if errorlevel 1 exit /b 1
set BUILDVC=%NEWBUILDVC%

:Continue
:: /Zi for debug.  /favor:INTEL64 is ignored for 32bit compiles.
if NOT DEFINED CFLAGS set CFLAGS=/DR123_NO_SINCOS=1 /I..\include /W3 /Ox /EHs /nologo /favor:INTEL64
set CC=cl
echo Using %VCBAT%
echo Building for %BUILDVC% with %CC% %CFLAGS%

:Loop
set BUILDFILES= ( kat_c.c kat_cpp.cpp pi_aes.cpp pi_capi.c pi_cppapi.cpp pi_microurng.cpp simple.c simplepp.cpp time_serial.c time_boxmuller.cpp timers.cpp ut_Engine.cpp ut_M128.cpp ut_ReinterpretCtr.cpp ut_aes.cpp ut_ars.c ut_carray.cpp ut_features.cpp ut_uniform.cpp )
FOR %%A IN %BUILDFILES% DO (
	%CC% %CFLAGS% %%A
	if errorlevel 1 exit /b 1
	%%~nA 
	if errorlevel 1 exit /b 1 )
endlocal