From 78e1d5cfdef4fbd6b2945a5b6ddd9b1d2efcabca Mon Sep 17 00:00:00 2001 From: Brian Gladman Date: Sat, 25 Jul 2015 20:10:02 +0100 Subject: [PATCH] tidy up batch files in Visual Studio build --- build.vc14/gen_config_h.bat | 2 ++ build.vc14/gen_mpir_h.bat | 4 +++- build.vc14/out_copy_rename.bat | 4 ++++ build.vc14/postbuild.bat | 5 +++-- build.vc14/prebuild.bat | 5 ++--- build.vc14/to_gmp.bat | 9 ++++----- build.vc14/to_mpir.bat | 9 ++++----- 7 files changed, 22 insertions(+), 16 deletions(-) diff --git a/build.vc14/gen_config_h.bat b/build.vc14/gen_config_h.bat index 98e3d28c..c37dd766 100644 --- a/build.vc14/gen_config_h.bat +++ b/build.vc14/gen_config_h.bat @@ -1,4 +1,6 @@ @echo off +rem %1 = directory holding config data (in cdata) + echo /* generated by gen_config_h.bat */ >tmp.h for /f %%a in (%1cfg.h) do (if "%%a" NEQ "" (echo #define HAVE_NATIVE_%%a 1 >>tmp.h)) diff --git a/build.vc14/gen_mpir_h.bat b/build.vc14/gen_mpir_h.bat index f1371c0c..ceabd914 100644 --- a/build.vc14/gen_mpir_h.bat +++ b/build.vc14/gen_mpir_h.bat @@ -1,6 +1,8 @@ @echo off +rem %1 = platform + echo creating mpir.h for %1 -echo /* generated from gmp-h.in by gen_mpir_h.bat */>tmp.h +echo /* generated from gmp-h.in by gen_mpir_h.bat */ >tmp.h rem if /i "%1" EQU "x64" ( rem echo ^#ifndef _WIN64 >>tmp.h diff --git a/build.vc14/out_copy_rename.bat b/build.vc14/out_copy_rename.bat index 17bc6626..8c513885 100644 --- a/build.vc14/out_copy_rename.bat +++ b/build.vc14/out_copy_rename.bat @@ -1,4 +1,8 @@ @echo off +rem %1 = source file path +rem %2 = destination directory +rem %3 = destination file name + if not exist %1 goto nofile if exist %2 goto next diff --git a/build.vc14/postbuild.bat b/build.vc14/postbuild.bat index 6314dfd6..615b55f0 100644 --- a/build.vc14/postbuild.bat +++ b/build.vc14/postbuild.bat @@ -1,4 +1,5 @@ @echo off +rem %1 = full target path set str=%~1 rem delete anything from the path before 'build.vc14' @@ -48,11 +49,10 @@ exit /b 0 rem copy binaries to final bin_dirination directory rem %1 = target (build output) directory -rem %2 = bin_dirination directory +rem %2 = binary destination directory rem %3 = configuration (debug/release) rem %4 = library (lib/dll) rem %5 = file name - :copyb if "%4" EQU "dll" ( copy %1mpir.dll %2mpir.dll > nul 2>&1 @@ -75,6 +75,7 @@ if "%4" EQU "dll" ( call :seterr & echo ERROR: illegal library type %4 & exit /b %errorlevel% ) +rem set configuration for the tests call gen_test_config_props %plat% %conf% exit /b 0 diff --git a/build.vc14/prebuild.bat b/build.vc14/prebuild.bat index d666a095..2c07ef22 100644 --- a/build.vc14/prebuild.bat +++ b/build.vc14/prebuild.bat @@ -1,14 +1,13 @@ - +@echo off rem %1 = mpn directory (generic, x86\... or x86_64\...) rem %2 = platform (win32 or x64) -@echo off if /i "%2" EQU "win32" ((set platform=win32) & (set bdir=x86w\)) else ((set platform=x64) & (set bdir=x86_64w\)) set sdir= if /i "%1" EQU "gc" ((set sdir=generic) & (set bdir=generic)) else (set sdir=%bdir%%1) if not exist ..\mpn\%sdir% (call :seterr & echo ERROR: %1 is not supported & exit /b %errorlevel%) -echo.building MPIR for %1 (%platform%) from directory mpn\%sdir% +echo building MPIR for %1 (%platform%) from directory mpn\%sdir% set cdir=cdata\mpn\%sdir%\ set sdir=..\mpn\%sdir%\ diff --git a/build.vc14/to_gmp.bat b/build.vc14/to_gmp.bat index 3ae6b4b8..0edad001 100644 --- a/build.vc14/to_gmp.bat +++ b/build.vc14/to_gmp.bat @@ -1,4 +1,5 @@ -echo off +@echo off + if exist lib\win32\release call :sub lib\win32\release if exist lib\win32\debug call :sub lib\win32\debug if exist lib\x64\release call :sub lib\x64\release @@ -14,14 +15,12 @@ exit /b 0 :sub echo off if not exist %1 exit /b 0 -cd %1 +pushd %1 if exist mpir.dll (ren mpir.dll gmp.dll) if exist mpir.lib (ren mpir.lib gmp.lib) if exist mpir.pdb (ren mpir.pdb gmp.pdb) if exist mpir.exp (ren mpir.exp gmp.exp) if exist mpirxx.lib (ren mpirxx.lib gmpxx.lib) if exist mpirxx.pdb (ren mpirxx.pdb gmpxx.pdb) -cd .. -cd .. -cd .. +popd exit /b 0 diff --git a/build.vc14/to_mpir.bat b/build.vc14/to_mpir.bat index 34ef19f0..cb082f0c 100644 --- a/build.vc14/to_mpir.bat +++ b/build.vc14/to_mpir.bat @@ -1,4 +1,5 @@ -echo off +@echo off + if exist lib\win32\release call :sub lib\win32\release if exist lib\win32\debug call :sub lib\win32\debug if exist lib\x64\release call :sub lib\x64\release @@ -13,14 +14,12 @@ exit /b 0 :sub echo off if not exist %1 exit /b 0 -cd %1 +pushd %1 if exist gmp.dll (ren gmp.dll mpir.dll) if exist gmp.lib (ren gmp.lib mpir.lib) if exist gmp.pdb (ren gmp.pdb mpir.pdb) if exist gmp.exp (ren gmp.exp mpir.exp) if exist gmpxx.lib (ren gmpxx.lib mpirxx.lib) if exist gmpxx.pdb (ren gmpxx.pdb mpirxx.pdb) -cd .. -cd .. -cd .. +popd exit /b 0