source: tol/building/Linux/build_package.sh @ 4ff8483

1941-docker-image-to-testdevel
Last change on this file since 4ff8483 was 4ff8483, checked in by Pedro Gea <pgea@…>, 11 years ago

Refs #1880
Se añade el atributo ejecutable a los scripts de Linux.
Se revisan los scripts para dejar sólo dos carpetas: MinGW y Linux.

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

  • Property mode set to 100755
File size: 1.7 KB
Line 
1#!/bin/bash
2#************************************************************
3# La llamada al script recibe dos argumentos:
4#   ./build_package.sh [|<package_name>] [|release|debug]
5#************************************************************
6# Durante el proceso se pregunta por cada una de las etapas.
7#************************************************************
8
9BUILD_DIR=$PWD/$(dirname $0)
10
11if [ "$1" = "" ]; then
12  echo -n "package? "
13  read package
14else
15  package=$1
16fi
17
18PACKAGE_DIR=$BUILD_DIR/../../../OfficialTolArchiveNetwork/$package
19if ![ -f "$PACKAGE_DIR/CMakeLists.txt" ]; then
20  if [ -d "$PACKAGE_DIR" ]; then
21    echo "(!) Cannot find the CMakeLists.txt"
22  else
23    echo "(!) Cannot find the package $package."
24  fi
25  exit
26fi
27
28if [ "$2" = "" ]; then
29  mode=release
30else
31  mode=$2
32fi
33if !([ "$mode" = "release" ] || [ "$mode" = "debug" ]); then
34  echo "(!) Second argument should be: release, debug or should be avoided."
35  exit
36fi
37suffix=-$mode
38if [ "$mode" = "release" ]; then
39  suffix=
40fi
41
42echo "----------------------------------------------------"
43echo " Building package $package - $mode"
44echo "----------------------------------------------------"
45
46CMAKE_DIR=~/CMake_Build/packages/$package/$mode
47if [ -d "$CMAKE_DIR" ]; then
48  echo "/!\ There is already a built folder of $package."
49  echo -n "mkdir? (y/n) "
50  read answer
51  if [ "$answer" = "y" ]; then
52    rm -r "$CMAKE_DIR"
53    mkdir -p "$CMAKE_DIR"
54  fi
55else
56  mkdir -p "$CMAKE_DIR"
57fi
58cd $CMAKE_DIR
59
60echo -n "cmake? (y/n) "
61read answer
62if [ "$answer" = "y" ]; then
63  cmake $PACKAGE_DIR -DTOL_PREFIX_PATH=/usr/local/tol3.2$suffix -DCMAKE_BUILD_TYPE=$mode
64fi
65
66echo -n "make? (y/n) "
67read answer
68if [ "$answer" = "y" ]; then
69  make
70fi
Note: See TracBrowser for help on using the repository browser.