2010-05-23 14:43:10 -04:00
|
|
|
@echo off
|
|
|
|
:: Copyright 2009 Jason Moxham
|
|
|
|
::
|
|
|
|
:: This file is part of the MPIR Library.
|
|
|
|
::
|
|
|
|
:: The MPIR Library is free software; you can redistribute it and/or modify
|
|
|
|
:: it under the terms of the GNU Lesser General Public License as published
|
|
|
|
:: by the Free Software Foundation; either version 2.1 of the License, or (at
|
|
|
|
:: your option) any later version.
|
|
|
|
::
|
|
|
|
:: The MPIR Library is distributed in the hope that it will be useful, but
|
|
|
|
:: WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
|
|
|
:: or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
|
|
|
|
:: License for more details.
|
|
|
|
::
|
|
|
|
:: You should have received a copy of the GNU Lesser General Public License
|
|
|
|
:: along with the MPIR Library; see the file COPYING.LIB. If not, write
|
|
|
|
:: to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
|
|
|
:: Boston, MA 02110-1301, USA.
|
|
|
|
::
|
|
|
|
if not exist config_params.bat (
|
|
|
|
echo run configure first
|
|
|
|
exit /b 1
|
|
|
|
)
|
|
|
|
call config_params.bat
|
|
|
|
if "%1" == "" goto :make
|
|
|
|
if "%1" == "clean" goto :clean
|
|
|
|
if "%1" == "install" goto :install
|
|
|
|
if "%1" == "check" goto :check
|
|
|
|
if "%1" == "speed" goto :speed
|
2010-05-23 17:00:07 -04:00
|
|
|
if "%1" == "tune" goto :tune
|
2010-05-23 14:43:10 -04:00
|
|
|
if "%1" == "try" goto :try
|
|
|
|
if "%1" == "help" (
|
|
|
|
echo Usage : make [clean^|install^|check^|speed^|tune^|try^|help]
|
|
|
|
exit /b 0
|
|
|
|
)
|
|
|
|
echo Unkwown option
|
|
|
|
exit /b 1
|
|
|
|
|
|
|
|
:make
|
2010-05-23 17:00:07 -04:00
|
|
|
|
|
|
|
set MS_BUILD="C:\Windows\Microsoft.NET\Framework64\v4.0.30319\msbuild.exe"
|
|
|
|
|
2010-05-23 14:43:10 -04:00
|
|
|
set LIBBUILD=%LIBTYPE%_mpir_%BCPU%
|
2010-05-23 17:00:07 -04:00
|
|
|
%MS_BUILD% gen-mpir\gen-mpir.vcxproj /p:Platform=Win32;Configuration=Release
|
|
|
|
%MS_BUILD% gen-bases\gen-bases.vcxproj /p:Platform=Win32;Configuration=Release
|
|
|
|
%MS_BUILD% gen-fac_ui\gen-fac_ui.vcxproj /p:Platform=Win32;Configuration=Release
|
|
|
|
%MS_BUILD% gen-fib\gen-fib.vcxproj /p:Platform=Win32;Configuration=Release
|
|
|
|
%MS_BUILD% gen-psqr\gen-psqr.vcxproj /p:Platform=Win32;Configuration=Release
|
|
|
|
|
2010-05-23 14:43:10 -04:00
|
|
|
if errorlevel 1 (
|
|
|
|
echo "ERROR PREBUILD"
|
|
|
|
exit /b 1
|
|
|
|
)
|
2010-05-23 17:00:07 -04:00
|
|
|
%MS_BUILD% %LIBBUILD%\%LIBBUILD%.vcxproj /p:Platform=%ARCHW%;Configuration=Release
|
|
|
|
|
2010-05-23 14:43:10 -04:00
|
|
|
if errorlevel 1 (
|
|
|
|
echo "ERROR BUILDING"
|
|
|
|
exit /b 1
|
|
|
|
)
|
|
|
|
:: c++ to build if static
|
|
|
|
if %LIBTYPE% == lib (
|
2010-05-23 17:00:07 -04:00
|
|
|
%MS_BUILD% lib_mpir_cxx\lib_mpir_cxx.vcxproj /p:Platform=%ARCHW%;Configuration=Release
|
2010-05-23 14:43:10 -04:00
|
|
|
if errorlevel 1 (
|
|
|
|
echo "ERROR BUILDING CXX"
|
|
|
|
exit /b 1
|
|
|
|
)
|
|
|
|
)
|
|
|
|
exit /b 0
|
|
|
|
|
|
|
|
:check
|
|
|
|
:: this gives an error if we dont build the c++ stuff
|
2010-05-23 17:00:07 -04:00
|
|
|
%MS_BUILD% mpir-tests.sln /p:Platform=%ARCHW%;Configuration=Release"
|
2010-05-23 14:43:10 -04:00
|
|
|
if errorlevel 1 (
|
|
|
|
echo "ERROR BUILDING TESTS"
|
|
|
|
exit /b 1
|
|
|
|
)
|
|
|
|
cd mpir-tests
|
2010-06-09 07:36:46 -04:00
|
|
|
@echo off
|
|
|
|
for /f "usebackq tokens=1*" %%f in (`reg query HKCR\Python.File\shell\open\command`) do (set _my_=%%f %%g)
|
2010-05-23 14:43:10 -04:00
|
|
|
if not errorlevel 1 goto :got
|
|
|
|
echo ERROR Could not find PYTHON
|
|
|
|
exit /b 1
|
|
|
|
:got
|
2010-06-09 07:36:46 -04:00
|
|
|
set _res_=%_my_:*REG_SZ=%
|
|
|
|
set _end_=%_res_:*exe"=%
|
|
|
|
call set _python_=%%_res_:%_end_%=%%
|
|
|
|
call %_python_% run-tests.py noenter
|
2010-05-23 14:43:10 -04:00
|
|
|
set RET=%ERRORLEVEL%
|
|
|
|
cd ..
|
|
|
|
exit /b %RET%
|
|
|
|
|
|
|
|
:install
|
|
|
|
echo HOW???
|
|
|
|
exit /b 1
|
|
|
|
|
|
|
|
:speed
|
2010-05-24 04:13:26 -04:00
|
|
|
%MS_BUILD% speed\speed.vcxproj /p:Platform=%ARCHW%;Configuration=Release
|
2010-05-23 17:00:07 -04:00
|
|
|
echo speed.exe is in %ARCHW%\Release\
|
|
|
|
exit /b 0
|
|
|
|
|
|
|
|
:tune
|
2010-05-24 04:13:26 -04:00
|
|
|
%MS_BUILD% tune\tune.vcxproj /p:Platform=%ARCHW%;Configuration=Release
|
2010-05-23 17:00:07 -04:00
|
|
|
echo tune.exe is in %ARCHW%\Release\
|
2010-05-23 14:43:10 -04:00
|
|
|
exit /b 0
|
|
|
|
|
|
|
|
:try
|
2010-05-23 17:00:07 -04:00
|
|
|
%MS_BUILD% try\try.vcxproj /p:Platform=%ARCHW%;Configuration=Release
|
2010-05-23 14:43:10 -04:00
|
|
|
echo try.exe is in try\%ARCHW%\Release\
|
|
|
|
exit /b 0
|
|
|
|
|
|
|
|
:clean
|
|
|
|
del config_params.bat config.guess.bat config.guess.exe config.guess.obj last_build.txt >nul 2>&1
|
|
|
|
del ..\config.h ..\mpir.h ..\gmp.h ..\gmp-mparam.h >nul 2>&1
|
|
|
|
del gen-psqr\gen-psqr.exe gen-fac_ui\gen-fac_ui.exe gen-bases\gen-bases.exe >nul 2>&1
|
|
|
|
del gen-fib\gen-fib.exe gen-mpir\gen-mpir.exe gen-mpir\gen-mpir.pdb >nul 2>&1
|
|
|
|
rmdir /s/q x64 win32 %LIBTYPE%_mpir_%BCPU%\%ARCHW% lib_mpir_cxx\%ARCHW% lib\%ARCHW% dll\%ARCHW% mpir-tests\%ARCHW% >nul 2>&1
|
|
|
|
rmdir /s/q gen-psqr\Win32 gen-fac_ui\Win32 gen-bases\Win32 gen-fib\Win32 gen-mpir\Win32 >nul 2>&1
|
|
|
|
rmdir /s/q lib_speed\%ARCHW% speed\%ARCHW% tune\%ARCHW% try\%ARCHW% >nul 2>&1
|
|
|
|
exit /b 0
|