1 | #!/bin/ksh |
---|
2 | # palm_simple_install - a script for simple installation and compilation of |
---|
3 | # the palm code without using mbuild |
---|
4 | # $Id: palm_simple_install 515 2010-03-18 02:30:38Z maronga $ |
---|
5 | |
---|
6 | # This script creates (from the working copy of the palm repository) |
---|
7 | # a subdirectory MAKE_DEPOSITORY_simple which contains a copy of the |
---|
8 | # palm source code and a modified makefile which loads required compiler |
---|
9 | # and preprocessor settings via "include MAKE.inc" |
---|
10 | |
---|
11 | # Options: -i <include file> |
---|
12 | # one of the include files in ~/palm/current_version/trunk/INSTALL |
---|
13 | |
---|
14 | # Last changes: |
---|
15 | # 25/01/10 - Siggi - Generating the first version |
---|
16 | # 18/03/10 - Siggi - switch to palm/current_version removed: working |
---|
17 | # copy can be in any directory |
---|
18 | |
---|
19 | |
---|
20 | # Variable declarations + default values |
---|
21 | include_file=unknown |
---|
22 | |
---|
23 | |
---|
24 | # Read shellscript options |
---|
25 | while getopts :i: option |
---|
26 | do |
---|
27 | case $option in |
---|
28 | (i) include_file=$OPTARG;; |
---|
29 | (\?) printf "\n +++ unknown option $OPTARG \n" |
---|
30 | printf "\n allowed option are -d, -f, -l, -s \n" |
---|
31 | exit;; |
---|
32 | esac |
---|
33 | done |
---|
34 | |
---|
35 | |
---|
36 | |
---|
37 | # Check, if include file exists |
---|
38 | if [[ ! -f trunk/INSTALL/$include_file ]] |
---|
39 | then |
---|
40 | echo "+++ ERROR: include file" |
---|
41 | echo " \"trunk/INSTALL/$include_file\"" |
---|
42 | echo " not found" |
---|
43 | exit |
---|
44 | fi |
---|
45 | |
---|
46 | |
---|
47 | # Create the make depository |
---|
48 | if [[ ! -d MAKE_DEPOSITORY_simple ]] |
---|
49 | then |
---|
50 | mkdir MAKE_DEPOSITORY_simple |
---|
51 | else |
---|
52 | rm MAKE_DEPOSITORY_simple/* |
---|
53 | fi |
---|
54 | |
---|
55 | |
---|
56 | # Copy makefile and all source code files to make depository |
---|
57 | cp trunk/SOURCE/Makefile MAKE_DEPOSITORY_simple/Makefile_old |
---|
58 | cp trunk/INSTALL/$include_file MAKE_DEPOSITORY_simple/MAKE.inc |
---|
59 | cp trunk/SOURCE/*.f90 MAKE_DEPOSITORY_simple |
---|
60 | |
---|
61 | |
---|
62 | # Replace comment in makefile by include statement |
---|
63 | sed 's/#to_be_replaced_by_include/include MAKE.inc/g' MAKE_DEPOSITORY_simple/Makefile_old > MAKE_DEPOSITORY_simple/Makefile |
---|
64 | rm MAKE_DEPOSITORY_simple/Makefile_old |
---|
65 | |
---|
66 | |
---|
67 | # Create directory for input files |
---|
68 | if [[ ! -d JOBS/example_cbl/INPUT ]] |
---|
69 | then |
---|
70 | mkdir -p JOBS/example_cbl/INPUT |
---|
71 | cp trunk/INSTALL/example_cbl_p3d JOBS/example_cbl/INPUT |
---|
72 | fi |
---|