1 | #!/bin/csh |
---|
2 | set verbose echo |
---|
3 | set has_arch_opt = FALSE |
---|
4 | set has_compile_opt = FALSE |
---|
5 | set default_compile_flags = "%PROD_FFLAGS" |
---|
6 | |
---|
7 | top: |
---|
8 | if ($#argv > 0) then |
---|
9 | switch ($1) |
---|
10 | |
---|
11 | case -h |
---|
12 | |
---|
13 | ######################################################################## |
---|
14 | # Manuel en ligne |
---|
15 | ######################################################################## |
---|
16 | more <<eod |
---|
17 | |
---|
18 | |
---|
19 | configure_ioserver [Options] |
---|
20 | |
---|
21 | bla, bla, bla |
---|
22 | eod |
---|
23 | exit |
---|
24 | |
---|
25 | ######################################################################## |
---|
26 | # Lecture des differentes options |
---|
27 | ######################################################################## |
---|
28 | |
---|
29 | case -a |
---|
30 | case -arch |
---|
31 | set has_arch_opt = TRUE |
---|
32 | set arch="$2" ; shift ; shift ; goto top |
---|
33 | |
---|
34 | case -prod |
---|
35 | set has_compile_opt = TRUE |
---|
36 | set compile_flags="%PROD_FFLAGS" |
---|
37 | shift ; goto top |
---|
38 | |
---|
39 | case -dev |
---|
40 | set has_compile_opt = TRUE |
---|
41 | set compile_flags="%DEV_FFLAGS" |
---|
42 | shift ; goto top |
---|
43 | |
---|
44 | case -debug |
---|
45 | set has_compile_opt = TRUE |
---|
46 | set compile_flags="%DEBUG_FFLAGS" |
---|
47 | shift ; goto top |
---|
48 | |
---|
49 | default |
---|
50 | echo "unknown option "$1" , exiting..." |
---|
51 | exit |
---|
52 | endsw |
---|
53 | endif |
---|
54 | |
---|
55 | |
---|
56 | #define architecture files |
---|
57 | if ( $has_arch_opt == TRUE) then |
---|
58 | if ( -e arch/arch-${arch}.fcm ) then |
---|
59 | rm -f arch.fcm |
---|
60 | ln -s arch/arch-${arch}.fcm arch.fcm |
---|
61 | else |
---|
62 | echo "architecture file : << arch/arch-${arch}.fcm >> is missing, exiting...." |
---|
63 | exit |
---|
64 | endif |
---|
65 | |
---|
66 | if ( -e arch/arch-${arch}.path ) then |
---|
67 | rm -f arch.path |
---|
68 | ln -s arch/arch-${arch}.path arch.path |
---|
69 | else |
---|
70 | echo "architecture file : << arch/arch-${arch}.path >> is missing, exiting...." |
---|
71 | exit |
---|
72 | endif |
---|
73 | else |
---|
74 | echo "Warning : architecture not specified, taking default file <<arch.fcm>> and <<arch.path>>" |
---|
75 | if ( ! -e arch.fcm ) then |
---|
76 | echo "architecture file : << arch.fcm >> is missing, exiting...." |
---|
77 | exit |
---|
78 | endif |
---|
79 | |
---|
80 | if ( ! -e arch.fcm ) then |
---|
81 | echo "architecture file : << arch.path >> is missing, exiting...." |
---|
82 | exit |
---|
83 | endif |
---|
84 | endif |
---|
85 | |
---|
86 | # set compiler flags |
---|
87 | set FFLAGS="%BASE_FFLAGS" |
---|
88 | set LD_FFLAGS="%BASE_LD" |
---|
89 | set CPP_KEY="%FPP_DEF" |
---|
90 | |
---|
91 | # set compiler flags for optimisation |
---|
92 | if ( $has_compile_opt == FALSE ) then |
---|
93 | set compile_flags=$default_compile_flags |
---|
94 | endif |
---|
95 | set FFLAGS=${FFLAGS}" "$compile_flags |
---|
96 | |
---|
97 | |
---|
98 | source ./arch.path |
---|
99 | |
---|
100 | # build config file |
---|
101 | set config_fcm="config.fcm" |
---|
102 | rm -f $config_fcm |
---|
103 | |
---|
104 | echo "%FFLAGS $FFLAGS" > $config_fcm |
---|
105 | echo "%CPP_KEY $CPP_KEY" >> $config_fcm |
---|
106 | echo "%LD_FFLAGS $LD_FFLAGS" >> $config_fcm |
---|