source: tol/building/MinGW/build.bat @ 021afa6

1941-docker-image-to-testdevel
Last change on this file since 021afa6 was 021afa6, checked in by Jorge Pérez <josp.jorge@…>, 11 years ago

se usan los toolchain optimizados para mingw

git-svn-id: ​https://www.tol-project.org/svn/tolp/trunk@7229 be4846ae-f051-483a-831f-b64e7d08527f

  • Property mode set to 100644
File size: 3.2 KB
Line 
1@echo off
2rem ************************************************************
3rem  La llamada al script recibe dos argumentos:
4rem    build [tol|toltcl|tolbase|rtol] [|Release|Debug]
5rem ************************************************************
6rem  Durante el proceso se pregunta por cada una de las etapas.
7rem ************************************************************
8setlocal enabledelayedexpansion
9
10set BUILD_DIR=%~dp0
11set BUILD_DIR=%BUILD_DIR:~0,-1%
12
13call !BUILD_DIR!\cmake_prepare.bat
14
15if !PROCESSOR_ARCHITECTURE!==x86 (
16  if "!platform!"=="" (
17    set platform=32
18  )
19  if not "!platform!"=="32" (
20    echo.^(^^!^) Current system cannot compile for !platform!-bit.
21    exit /b
22  )
23  set platform=32
24) else (
25  if "!platform!"=="" (
26    set /p platform="platform (32/64)? "
27  )
28  if not "!platform!"=="32" if not "!platform!"=="64" (
29    echo.^(^^!^) Platform word size should be 32 or 64.
30    exit /b
31  )
32)
33
34if "%1"=="" (
35  set /p project="project? "
36) else (
37  set project=%1
38)
39if "!project!"=="tol" goto project_ok
40if "!project!"=="toltcl" goto project_ok
41if "!project!"=="tolbase" goto project_ok
42if "!project!"=="rtol" goto project_ok
43echo.^(^^!^) First argument should be: tol, toltcl, tolbase or rtol.
44exit /b
45:project_ok
46
47set PROJECT_DIR=!BUILD_DIR!\..\..\!project!
48if not exist "!PROJECT_DIR!" (
49  echo.^(^^!^) Cannot find folder: !PROJECT_DIR!
50  exit /b
51)
52
53set mode=%2
54if "!mode!"=="" set mode=Release
55if "!mode!"=="Release" goto mode_ok
56if "!mode!"=="Debug" goto mode_ok
57echo.^(^^!^) Second argument should be: Release, Debug or should be avoided.
58exit /b
59:mode_ok
60
61echo.
62echo.----------------------------------------------------
63echo. Building !project! - !mode! ^(!platform!^)
64echo.----------------------------------------------------
65
66if "!project!"=="tol" (
67  set TOL_CONTRIBS=!BUILD_DIR!\..\..\..\toldevel-rtools-m!platform!
68  if not exist "!TOL_CONTRIBS!" (
69    echo.^(^^!^) Cannot find folder: !TOL_CONTRIBS!
70    exit /b
71  )
72)
73
74set CMAKE_DIR=!USERPROFILE!\CMake_Build\!project!\!mode!-!platform!
75if exist "!CMAKE_DIR!" (
76  echo.
77  echo./^^!\ There is already a built folder of !project!
78  set /p answer="mkdir? (y/n) "
79  if "!answer!"=="y" (
80    rmdir /s /Q "!CMAKE_DIR!"
81    mkdir "!CMAKE_DIR!"
82  )
83) else (
84  mkdir "!CMAKE_DIR!"
85)
86cd "!CMAKE_DIR!"
87
88echo.
89set /p answer="cmake? (y/n) "
90if "!answer!"=="y" (
91  set CMAKE_TOOLCHAIN=!BUILD_DIR!\..\..\tol\cmake\mingw-m!platform!-O3-mtune_native.toolchain.cmake
92  if "!project!"=="tol" (
93    cmake -DCLAPACK_NAME=lapacke -DTOL_EXTERNAL_DEVEL_DIR="!TOL_CONTRIBS!" -DCMAKE_TOOLCHAIN_FILE="!CMAKE_TOOLCHAIN!" -DCMAKE_BUILD_TYPE=!mode! -G"CodeLite - MinGW Makefiles" "!PROJECT_DIR!"
94  ) else (
95    set TOL_RUNTIME=!USERPROFILE!\CMake_Build\tol\!mode!-!platform!\Runtime_Base
96    cmake -DTOL_PREFIX_PATH="!TOL_RUNTIME!" -DCMAKE_TOOLCHAIN_FILE="!CMAKE_TOOLCHAIN!" -DCMAKE_INSTALL_PREFIX= -DCMAKE_BUILD_TYPE=!mode! -G"CodeLite - MinGW Makefiles" "!PROJECT_DIR!"
97  )
98)
99
100echo.
101set /p answer="make? (y/n) "
102if "!answer!"=="y" (
103  mingw32-make
104)
105
106echo.
107set /p answer="install? (y/n) "
108if "!answer!"=="y" (
109  mingw32-make install
110)
111
112cd "!BUILD_DIR!"
113echo.
114exit /b
Note: See TracBrowser for help on using the repository browser.