source: XMLIO_V2/dev/trunk/make_xmlioserver @ 79

Last change on this file since 79 was 79, checked in by ymipsl, 15 years ago

import dev/trunk

File size: 1.4 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_CFLAGS="%PROD_CFLAGS"
55  COMPIL_FFLAGS="%PROD_FFLAGS"
56elif [[ "$compil_mode" == "dev" ]]
57then
58  COMPIL_CFLAGS="%DEV_CFLAGS"
59  COMPIL_FFLAGS="%DEV_FFLAGS"
60elif [[ "$compil_mode" == "debug" ]]
61then
62  COMPIL_CFLAGS="%DEBUG_CFLAGS"
63  COMPIL_FFLAGS="%DEBUG_FFLAGS"
64fi
65
66rm -f config.fcm
67
68echo "%COMPIL_CFLAGS $COMPIL_CFLAGS" >> config.fcm
69echo "%COMPIL_FFLAGS $COMPIL_FFLAGS" >> config.fcm
70
71fcm build
Note: See TracBrowser for help on using the repository browser.