1 | #!/bin/bash |
---|
2 | #--------------------------------------------------------------------------------# |
---|
3 | # This file is part of PALM. |
---|
4 | # |
---|
5 | # PALM is free software: you can redistribute it and/or modify it under the terms |
---|
6 | # of the GNU General Public License as published by the Free Software Foundation, |
---|
7 | # either version 3 of the License, or (at your option) any later version. |
---|
8 | # |
---|
9 | # PALM is distributed in the hope that it will be useful, but WITHOUT ANY |
---|
10 | # WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR |
---|
11 | # A PARTICULAR PURPOSE. See the GNU General Public License for more details. |
---|
12 | # |
---|
13 | # You should have received a copy of the GNU General Public License along with |
---|
14 | # PALM. If not, see <http://www.gnu.org/licenses/>. |
---|
15 | # |
---|
16 | # Copyright 1997-2014 Leibniz Universitaet Hannover |
---|
17 | #--------------------------------------------------------------------------------# |
---|
18 | # |
---|
19 | # Current revisions: |
---|
20 | # ----------------- |
---|
21 | # |
---|
22 | # |
---|
23 | # Former revisions: |
---|
24 | # ----------------- |
---|
25 | # $Id: palm_simple_install 2226 2017-05-16 11:38:11Z kanani $ |
---|
26 | # |
---|
27 | # 2225 2017-05-16 11:36:20Z raasch |
---|
28 | # shell changed to bash |
---|
29 | # |
---|
30 | # 1046 2012-11-09 14:38:45Z maronga |
---|
31 | # code put under GPL (PALM 3.9) |
---|
32 | # |
---|
33 | # palm_simple_install - a script for simple installation and compilation of |
---|
34 | # the palm code without using mbuild |
---|
35 | # This script creates (from the working copy of the palm repository) |
---|
36 | # a subdirectory MAKE_DEPOSITORY_simple which contains a copy of the |
---|
37 | # palm source code and a modified makefile which loads required compiler |
---|
38 | # and preprocessor settings via "include MAKE.inc" |
---|
39 | |
---|
40 | # Options: -i <include file> |
---|
41 | # one of the include files in ~/palm/current_version/trunk/INSTALL |
---|
42 | |
---|
43 | # Last changes: |
---|
44 | # 25/01/10 - Siggi - Generating the first version |
---|
45 | # 18/03/10 - Siggi - switch to palm/current_version removed: working |
---|
46 | # copy can be in any directory |
---|
47 | |
---|
48 | |
---|
49 | # Variable declarations + default values |
---|
50 | include_file=unknown |
---|
51 | |
---|
52 | |
---|
53 | # Read shellscript options |
---|
54 | while getopts :i: option |
---|
55 | do |
---|
56 | case $option in |
---|
57 | (i) include_file=$OPTARG;; |
---|
58 | (\?) printf "\n +++ unknown option $OPTARG \n" |
---|
59 | printf "\n allowed option are -d, -f, -l, -s \n" |
---|
60 | exit;; |
---|
61 | esac |
---|
62 | done |
---|
63 | |
---|
64 | |
---|
65 | |
---|
66 | # Check, if include file exists |
---|
67 | if [[ ! -f trunk/INSTALL/$include_file ]] |
---|
68 | then |
---|
69 | echo "+++ ERROR: include file" |
---|
70 | echo " \"trunk/INSTALL/$include_file\"" |
---|
71 | echo " not found" |
---|
72 | exit |
---|
73 | fi |
---|
74 | |
---|
75 | |
---|
76 | # Create the make depository |
---|
77 | if [[ ! -d MAKE_DEPOSITORY_simple ]] |
---|
78 | then |
---|
79 | mkdir MAKE_DEPOSITORY_simple |
---|
80 | else |
---|
81 | rm MAKE_DEPOSITORY_simple/* |
---|
82 | fi |
---|
83 | |
---|
84 | |
---|
85 | # Copy makefile and all source code files to make depository |
---|
86 | cp trunk/SOURCE/Makefile MAKE_DEPOSITORY_simple/Makefile_old |
---|
87 | cp trunk/INSTALL/$include_file MAKE_DEPOSITORY_simple/MAKE.inc |
---|
88 | cp trunk/SOURCE/*.f90 MAKE_DEPOSITORY_simple |
---|
89 | |
---|
90 | |
---|
91 | # Replace comment in makefile by include statement |
---|
92 | sed 's/#to_be_replaced_by_include/include MAKE.inc/g' MAKE_DEPOSITORY_simple/Makefile_old > MAKE_DEPOSITORY_simple/Makefile |
---|
93 | rm MAKE_DEPOSITORY_simple/Makefile_old |
---|
94 | |
---|
95 | |
---|
96 | # Create directory for input files |
---|
97 | if [[ ! -d JOBS/example_cbl/INPUT ]] |
---|
98 | then |
---|
99 | mkdir -p JOBS/example_cbl/INPUT |
---|
100 | cp trunk/INSTALL/example_cbl_p3d JOBS/example_cbl/INPUT |
---|
101 | fi |
---|