1 | |
---|
2 | cflags = $(CFLAGS) |
---|
3 | cppflags = $(CFLAGS) |
---|
4 | fflags = $(CFLAGS) |
---|
5 | |
---|
6 | cc = cc |
---|
7 | ccomp = $(cc) -c -I$(inc) $(cflags) |
---|
8 | clink = $(cc) |
---|
9 | |
---|
10 | cpp = g++ |
---|
11 | cppcomp = $(cpp) -c -I$(inc) $(cppflags) |
---|
12 | cpplink = $(cpp) |
---|
13 | |
---|
14 | for = f77 |
---|
15 | fcomp = $(for) -c -I$(inc) $(fflags) |
---|
16 | flink = $(for) |
---|
17 | |
---|
18 | lexflags = |
---|
19 | lex = lex $(lexflags) |
---|
20 | |
---|
21 | yaccflags = |
---|
22 | yacc = yacc $(yaccflags) |
---|
23 | |
---|
24 | mkdir = mkdir |
---|
25 | |
---|
26 | comp = $(ccomp) |
---|
27 | link = $(cc) |
---|
28 | |
---|
29 | ar = ar -crl |
---|
30 | ranlib = ranlib |
---|
31 | |
---|
32 | tag = $(CMTCONFIG) |
---|
33 | tags = $(CMTEXTRATAGS) |
---|
34 | |
---|
35 | src = ../src/ |
---|
36 | inc = ../src/ |
---|
37 | mgr = ../mgr/ |
---|
38 | cmt = ../cmt/ |
---|
39 | bin = ../$(tag)/ |
---|
40 | |
---|
41 | build_strategy = rebuild_makefiles |
---|
42 | build_dependencies = echo |
---|
43 | |
---|
44 | |
---|
45 | #--------------------------------------------- |
---|
46 | # Controlling the verbosity of Make |
---|
47 | # |
---|
48 | |
---|
49 | ifdef QUIET |
---|
50 | LEX_QUIET = 1 |
---|
51 | YACC_QUIET = 1 |
---|
52 | C_QUIET = 1 |
---|
53 | CPP_QUIET = 1 |
---|
54 | FORTRAN_QUIET = 1 |
---|
55 | JAVA_QUIET = 1 |
---|
56 | LINK_QUIET = 1 |
---|
57 | LIB_QUIET = 1 |
---|
58 | CLEANUP_QUIET = 1 |
---|
59 | silent = @ |
---|
60 | echo = @/bin/echo |
---|
61 | else |
---|
62 | silent = |
---|
63 | echo = @- echo |
---|
64 | endif |
---|
65 | |
---|
66 | ifdef LEX_QUIET |
---|
67 | lex_silent = @ |
---|
68 | lex_echo = @/bin/echo rebuilding |
---|
69 | else |
---|
70 | lex_silent = |
---|
71 | lex_echo = $(echo) |
---|
72 | endif |
---|
73 | |
---|
74 | ifdef YACC_QUIET |
---|
75 | yacc_silent = @ |
---|
76 | yacc_echo = @/bin/echo rebuilding |
---|
77 | else |
---|
78 | yacc_silent = |
---|
79 | yacc_echo = $(echo) |
---|
80 | endif |
---|
81 | |
---|
82 | ifdef C_QUIET |
---|
83 | c_silent = @ |
---|
84 | c_echo = @/bin/echo rebuilding |
---|
85 | else |
---|
86 | c_silent = |
---|
87 | c_echo = $(echo) |
---|
88 | endif |
---|
89 | |
---|
90 | ifdef CPP_QUIET |
---|
91 | cpp_silent = @ |
---|
92 | cpp_echo = @/bin/echo rebuilding |
---|
93 | else |
---|
94 | cpp_silent = |
---|
95 | cpp_echo = $(echo) |
---|
96 | endif |
---|
97 | |
---|
98 | ifdef FORTRAN_QUIET |
---|
99 | fortran_silent = @ |
---|
100 | fortran_echo = @/bin/echo rebuilding |
---|
101 | else |
---|
102 | fortran_silent = |
---|
103 | fortran_echo = $(echo) |
---|
104 | endif |
---|
105 | |
---|
106 | ifdef JAVA_QUIET |
---|
107 | java_silent = @ |
---|
108 | java_echo = @/bin/echo rebuilding |
---|
109 | else |
---|
110 | java_silent = |
---|
111 | java_echo = $(echo) |
---|
112 | endif |
---|
113 | |
---|
114 | ifdef LINK_QUIET |
---|
115 | link_silent = @ |
---|
116 | link_echo = @/bin/echo rebuilding |
---|
117 | else |
---|
118 | link_silent = |
---|
119 | link_echo = $(echo) |
---|
120 | endif |
---|
121 | |
---|
122 | ifdef LIB_QUIET |
---|
123 | lib_silent = @ |
---|
124 | lib_echo = @/bin/echo rebuilding |
---|
125 | else |
---|
126 | lib_silent = |
---|
127 | lib_echo = $(echo) |
---|
128 | endif |
---|
129 | |
---|
130 | ifdef CLEANUP_QUIET |
---|
131 | cleanup_silent = @ |
---|
132 | cleanup_echo = @/bin/echo removing |
---|
133 | else |
---|
134 | cleanup_silent = |
---|
135 | cleanup_echo = $(echo) |
---|
136 | endif |
---|
137 | |
---|
138 | cmtexe = $(CMTROOT)/$(CMTBIN)/cmt.exe |
---|
139 | |
---|
140 | SHELL = /bin/sh |
---|
141 | |
---|
142 | all :: setup.make checkuses |
---|
143 | |
---|
144 | ## @if [ ! "`${CMTROOT}/mgr/cmt show uses | grep 'found'`" = "" ] ; then \ |
---|
145 | |
---|
146 | checkuses : |
---|
147 | @if test "$(build_strategy)" = "rebuild_makefiles"; then \ |
---|
148 | echo "Checking configuration"; \ |
---|
149 | a=`${CMTROOT}/mgr/cmt show strategies | grep keep_makefiles`; \ |
---|
150 | if test "$${a}" = ""; then \ |
---|
151 | /bin/rm -f constituents.make setup.make $(tag).make; \ |
---|
152 | fi; \ |
---|
153 | $(cmtexe) check configuration -tag=$(tags); \ |
---|
154 | touch checkuses; \ |
---|
155 | fi |
---|
156 | |
---|
157 | dirs :: checkuses |
---|
158 | @if test ! -r requirements ; then echo "No requirements file" ; fi; \ |
---|
159 | if test ! -d $(bin) ; then $(mkdir) -p $(bin) ; fi; \ |
---|
160 | /bin/rm -f checkuses |
---|
161 | |
---|
162 | javadirs :: |
---|
163 | @if test ! -d $(javabin) ; then $(mkdir) -p $(javabin) ; fi |
---|
164 | |
---|
165 | srcdirs :: |
---|
166 | @if test ! -d $(src) ; then $(mkdir) -p $(src) ; fi |
---|
167 | |
---|
168 | cmt_path.make :: checkuses |
---|
169 | @if test ! -f cmt_path.make -o "$(build_strategy)" = "rebuild_makefiles"; then \ |
---|
170 | echo "Rebuilding $@"; \ |
---|
171 | a=`$(cmtexe) show path -tag=$(tags) -quiet`; \ |
---|
172 | b=`$(cmtexe) show tags -tag=$(tags) -quiet`; \ |
---|
173 | /bin/rm -f cmt_path.make; \ |
---|
174 | echo '#'$${a} >cmt_path.make; \ |
---|
175 | echo '#'$${b} >>cmt_path.make; \ |
---|
176 | fi |
---|
177 | |
---|
178 | ### $(cmtexe) check_files cmt_path.make.tmp cmt_path.make; |
---|
179 | |
---|
180 | -include cmt_path.make |
---|
181 | |
---|
182 | setup.make : cmt_path.make requirements # $(CMTROOT)/mgr/cmt |
---|
183 | @if test ! -f setup.make -o "$(build_strategy)" = "rebuild_makefiles"; then \ |
---|
184 | echo "Rebuilding $@"; \ |
---|
185 | $(cmtexe) build make_setup -quiet -tag=$(tags) ; \ |
---|
186 | fi |
---|
187 | |
---|
188 | -include setup.make |
---|
189 | |
---|
190 | $(gmake_hosts) :: |
---|
191 | rsh $@ "sh -c '(cd `$(cmtexe) show pwd -quiet`; . setup.sh; gmake $(MAKEFLAGS) $(target))'" |
---|
192 | |
---|
193 | $(make_hosts) :: |
---|
194 | rsh $@ "sh -c '(cd `$(cmtexe) show pwd`; . setup.sh; make $(MAKEFLAGS) $(target))'" |
---|
195 | |
---|
196 | everywhere :: $(everywhere) |
---|
197 | |
---|
198 | clean :: checkuses |
---|
199 | |
---|
200 | ## @echo clean done |
---|
201 | |
---|
202 | check :: |
---|
203 | @echo check done |
---|
204 | |
---|
205 | help :: dirs setup.make |
---|
206 | @echo '--------------------------------------------------------------------------' |
---|
207 | @echo 'You may select one of the following make targets :' |
---|
208 | @echo ' ' |
---|
209 | @echo 'help : this help' |
---|
210 | @echo 'all : rebuild everything according to the $$(constituents) macro' |
---|
211 | @echo ' (this is the default target)' |
---|
212 | @echo 'clean : remove everything that can be rebuilt' |
---|
213 | @echo 'makefilesclean : remove configuration files (*.make)' |
---|
214 | @echo ' ' |
---|
215 | @groups=`$(cmtexe) show groups -tag=$(tags)`; \ |
---|
216 | echo "all $${groups} : " |
---|
217 | @echo ' rebuild all constituents of one of these groups' |
---|
218 | @echo ' ' |
---|
219 | @all=""; \ |
---|
220 | for c in `$(cmtexe) show constituent_names -tag=$(tags)` ; do \ |
---|
221 | if test ! "$${all}" = ""; then all="$${all} "; fi; \ |
---|
222 | all="$${all}$${c}" ; \ |
---|
223 | done; \ |
---|
224 | echo "$${all} : " |
---|
225 | @echo ' rebuild one of these constituents' |
---|
226 | @echo ' ' |
---|
227 | @echo 'check :' |
---|
228 | @echo ' run all applications defined with the -check option' |
---|
229 | @echo ' ' |
---|
230 | @echo 'everywhere [target=...] : ' |
---|
231 | @echo ' o Rebuild on all plateforms specified in the $$(everywhere) macro' |
---|
232 | @echo ' o Use "cmt show macro everywhere -tag=<site>" to check it' |
---|
233 | @echo ' o The "target" option permits to transmit a target to the remote site' |
---|
234 | |
---|
235 | always :: |
---|
236 | |
---|
237 | .DEFAULT :: |
---|
238 | @echo "No action for $@" |
---|
239 | |
---|