2010-07-12 11:53:49 -04:00
|
|
|
@echo off
|
2011-01-24 15:35:46 -05:00
|
|
|
rem remove any quotes around the full file path
|
2011-01-21 14:52:37 -05:00
|
|
|
set str=%1
|
|
|
|
for /f "useback tokens=*" %%a in ('%str%') do set str=%%~a
|
2010-08-28 06:03:41 -04:00
|
|
|
|
2011-01-24 15:35:46 -05:00
|
|
|
rem delete anything from path before 'build.vc10'
|
2011-01-21 14:52:37 -05:00
|
|
|
:dele
|
2011-01-24 15:35:46 -05:00
|
|
|
set str=%str:~1%
|
2011-01-21 14:52:37 -05:00
|
|
|
set str2=%str:~0,10%
|
|
|
|
if "%str2%" NEQ "build.vc10" goto dele
|
2010-08-28 06:03:41 -04:00
|
|
|
|
2011-01-24 15:35:46 -05:00
|
|
|
rem we now have: build.vc10\<win32|x64>\<debug|release>\mpir.<lib|dll>
|
|
|
|
|
|
|
|
rem extract platform (plat=<win32|x64>), configuration (conf=<debug|release>) anbd file name
|
2011-01-21 14:52:37 -05:00
|
|
|
set file=
|
|
|
|
for /f "tokens=1,2,3,4 delims=\" %%a in ("%str%") do set plat=%%b&set conf=%%c&set file=%%d
|
|
|
|
if /i "%file%" NEQ "" (goto next)
|
2010-08-28 06:03:41 -04:00
|
|
|
call :seterr & echo ERROR: %1 is not supported & exit /b %errorlevel%
|
|
|
|
|
|
|
|
:next
|
2011-01-21 14:52:37 -05:00
|
|
|
rem echo platform= %plat% configuration= %conf%, file= %file%
|
|
|
|
|
2011-01-24 15:35:46 -05:00
|
|
|
rem get the filename extension (lib/dll) to set the output directory
|
2011-01-21 14:52:37 -05:00
|
|
|
set extn=%file%#
|
2011-01-24 15:35:46 -05:00
|
|
|
set extn=%extn:~-4,3%
|
2010-07-12 11:53:49 -04:00
|
|
|
|
2011-01-21 14:52:37 -05:00
|
|
|
rem set the target aand output directories
|
|
|
|
set source="%plat%\%conf%"
|
|
|
|
set dest="%extn%\%plat%\%conf%"
|
2010-07-12 11:53:49 -04:00
|
|
|
|
2011-01-24 15:35:46 -05:00
|
|
|
rem output parametrers for the MPIR tests
|
|
|
|
echo (set libr=%extn%) > output_params.bat
|
|
|
|
echo (set plat=%plat%) >> output_params.bat
|
|
|
|
echo (set conf=%conf%) >> output_params.bat
|
|
|
|
|
2011-01-21 14:52:37 -05:00
|
|
|
echo copying outputs from %source% to %dest%
|
|
|
|
if not exist %dest% md %dest%
|
|
|
|
call :copyh %dest%
|
|
|
|
call :copyb %source% %dest% %conf% %extn%
|
|
|
|
exit /b 0
|
2010-07-12 11:53:49 -04:00
|
|
|
|
2011-01-21 14:52:37 -05:00
|
|
|
rem copy binaries to final destination directory
|
|
|
|
rem %1 = source directory %2 = destination directory
|
|
|
|
rem %3 = library (lib/dll) %4 = configuration (debug/releaase)
|
|
|
|
:copyb
|
|
|
|
if "%4" EQU "dll" (
|
|
|
|
copy %1\mpir.dll %2\mpir.dll
|
|
|
|
copy %1\mpir.exp %2\mpir.exp
|
|
|
|
copy %1\mpir.lib %2\mpir.lib
|
|
|
|
if exist %1\mpir.pdb (copy %1\mpir.pdb %2\mpir.pdb)
|
|
|
|
copy mpir-tests\%4-%3-config.props mpir-tests\test-config.props
|
|
|
|
) else if "%4" EQU "lib" (
|
|
|
|
copy %1\mpir.lib %2\mpir.lib
|
|
|
|
if exist %1\mpir.pdb (copy %1\mpir.pdb %2\mpir.pdb)
|
|
|
|
copy mpir-tests\%4-%3-config.props mpir-tests\test-config.props
|
2010-07-15 17:00:06 -04:00
|
|
|
) else (
|
2011-01-21 14:52:37 -05:00
|
|
|
call :seterr & echo ERROR: illegal library type %4 & exit /b %errorlevel%
|
2010-07-15 17:00:06 -04:00
|
|
|
)
|
2010-07-12 11:53:49 -04:00
|
|
|
exit /b 0
|
|
|
|
|
2011-01-21 14:52:37 -05:00
|
|
|
rem copy headers to final destination directory
|
2010-07-12 11:53:49 -04:00
|
|
|
:copyh
|
2010-08-23 16:45:26 -04:00
|
|
|
copy ..\config.h %1\config.h
|
|
|
|
copy ..\gmp-mparam.h %1\gmp-mparam.h
|
|
|
|
copy ..\mpir.h %1\mpir.h
|
|
|
|
copy ..\mpir.h %1\gmp.h
|
|
|
|
copy ..\mpirxx.h %1\mpirxx.h
|
|
|
|
copy ..\mpirxx.h %1\gmpxx.h
|
2010-07-12 11:53:49 -04:00
|
|
|
exit /b 0
|
|
|
|
|
|
|
|
:seterr
|
|
|
|
exit /b 1
|