source: XMLIO_V2/external/make_external @ 80

Last change on this file since 80 was 80, checked in by ymipsl, 14 years ago

ajout lib externe

File size: 1.2 KB
Line 
1#!/bin/bash
2set -x
3export PATH=$PWD/../tools/FCM/bin:$PATH
4
5compil_mode_defined="FALSE"
6compil_mode="prod"
7
8arch_defined="FALSE"
9arch=""
10
11while (($# > 0))
12  do
13  case $1 in
14      "-h") cat <<fin
15Usage :
16makegcm [options] -m arch exec
17[-h]                       : help
18[-prod / -dev / -debug]    : compilation en mode production (default) / developpement / debug .
19 -arch nom_arch            : nom de l\'architecture cible
20fin
21          exit;;
22
23      "-prod")
24          compil_mode="prod" ; shift ;;
25
26      "-dev")
27          compil_mode="dev" ; shift ;;
28
29      "-debug")
30          compil_mode="debug" ; shift ;;
31
32      "-arch")
33          arch=$2 ; arch_defined="TRUE"; shift ; shift ;;
34
35      *)
36          code="$1" ; shift ;;
37  esac
38done
39
40if [[ "$arch_defined" == "TRUE" ]]
41then
42  rm -f arch.path
43  rm -f arch.fcm
44  ln -s arch/arch-${arch}.path ./arch.path
45  ln -s arch/arch-${arch}.fcm  ./arch.fcm
46  source arch.path
47else
48  echo "Veuillez definir une architecture cible"
49  exit 1
50fi
51
52if [[ "$compil_mode" == "prod" ]]
53then
54  COMPIL_FLAGS="%PROD_FLAGS"
55elif [[ "$compil_mode" == "dev" ]]
56then
57  COMPIL_FLAGS="%DEV_FLAGS"
58elif [[ "$compil_mode" == "debug" ]]
59then
60  COMPIL_FLAGS="%DEBUG_FLAGS"
61fi
62
63rm -f config.fcm
64
65echo "%COMPIL_FLAGS $COMPIL_FLAGS" >> config.fcm
66
67fcm build
Note: See TracBrowser for help on using the repository browser.