1 | |
---|
2 | cppflags = $(CFLAGS) |
---|
3 | |
---|
4 | |
---|
5 | cpp = g++ |
---|
6 | |
---|
7 | ifeq ($(CMTBIN),Linux) |
---|
8 | cpp = g++ -O2 |
---|
9 | endif |
---|
10 | |
---|
11 | ifeq ($(CMTBIN),LinuxDebug) |
---|
12 | cpp = g++ -g |
---|
13 | endif |
---|
14 | |
---|
15 | ifeq ($(CMTBIN),LinuxProf) |
---|
16 | cpp = g++ -g -pg |
---|
17 | endif |
---|
18 | |
---|
19 | |
---|
20 | ifeq ($(CMTBIN),LinuxInsure) |
---|
21 | cpp = insure -g |
---|
22 | endif |
---|
23 | |
---|
24 | ifeq ($(CMTBIN),OSF1DEB) |
---|
25 | cpp = cxx -g3 -pg |
---|
26 | endif |
---|
27 | |
---|
28 | ifeq ($(CMTBIN),OSF1) |
---|
29 | cpp = cxx |
---|
30 | endif |
---|
31 | |
---|
32 | ifeq ($(CMTBIN),SunOS) |
---|
33 | cpp = CC |
---|
34 | endif |
---|
35 | |
---|
36 | ifeq ($(CMTBIN),HP-UX) |
---|
37 | cpp = aCC |
---|
38 | endif |
---|
39 | |
---|
40 | ifeq ($(CMTBIN),Darwin) |
---|
41 | cpp = c++ -O2 |
---|
42 | endif |
---|
43 | |
---|
44 | ifeq ($(CMTBIN),LynxOS) |
---|
45 | cpp = g++ |
---|
46 | endif |
---|
47 | |
---|
48 | #ifeq ($(CMTBIN),OSF1) |
---|
49 | #remote_launch = rsh |
---|
50 | #else |
---|
51 | remote_launch = ssh |
---|
52 | #endif |
---|
53 | |
---|
54 | |
---|
55 | cppcomp = $(cpp) -c -I${inc} $(cppflags) |
---|
56 | cpplink = $(cpp) |
---|
57 | |
---|
58 | src = ../src/ |
---|
59 | inc = ../src/ |
---|
60 | mgr = ../mgr/ |
---|
61 | bin = ../${CMTBIN}/ |
---|
62 | binshort = ../${CMTBIN} |
---|
63 | |
---|
64 | cpp_silent = |
---|
65 | cpp_echo = @---> |
---|
66 | link_silent = |
---|
67 | link_echo = @---> |
---|
68 | |
---|
69 | SHELL = /bin/sh |
---|
70 | |
---|
71 | tag = |
---|
72 | |
---|
73 | application_suffix = .exe |
---|
74 | cmtexe = $(CMTROOT)/$(CMTBIN)/cmt.exe |
---|
75 | |
---|
76 | build_dependencies = test -d $(bin) || mkdir -p $(binshort); test -f $(cmtexe) || cp ../mgr/cmt_dependencies.make $(bin) ; echo |
---|
77 | |
---|
78 | PACKAGE_ROOT = ${CMTROOT} |
---|
79 | |
---|
80 | all :: dirs |
---|
81 | -@cd $(bin); /bin/rm -f last-rebuild; date >last-rebuild |
---|
82 | |
---|
83 | dirs :: |
---|
84 | @if test ! -d $(bin) ; then mkdir $(binshort) ; fi |
---|
85 | |
---|
86 | #--------------------------------------------------------- |
---|
87 | # |
---|
88 | # A list of some hosts where it is possible to rebuild CMT |
---|
89 | # |
---|
90 | #--------------------------------------------------------- |
---|
91 | hosts = asc dxplus papou1-fe hp2 aleph hp1 hpplus ccahp atlas04 ccasn atlas50 |
---|
92 | gmake_hosts = lx1 atlinux lxtest ax7 ccali ccali61 atlas |
---|
93 | make_hosts = virgo-control1 rio0a vmpc38a vmpc13a |
---|
94 | zsh_hosts = ccars rsplus |
---|
95 | #--------------------------------------------------------- |
---|
96 | |
---|
97 | #--------------------------------------------------------- |
---|
98 | # |
---|
99 | # Re-building CMT |
---|
100 | # |
---|
101 | #--------------------------------------------------------- |
---|
102 | |
---|
103 | done : |
---|
104 | @echo "CMT has been succesfully rebuilt." |
---|
105 | |
---|
106 | # @echo "A mail to Christian Arnault is now being sent to acknowledge" |
---|
107 | # @echo "your use of CMT". |
---|
108 | # @echo "Congratulations !!!" |
---|
109 | # @echo "CMT rebuilt at $(target)(`hostname`) by ${USER} in ${CMTROOT}" | \ |
---|
110 | # mail arnault@lal.in2p3.fr |
---|
111 | |
---|
112 | ### mailx -s "CMT rebuilt by ${USER} at `hostname`" arnault@lal.in2p3.fr |
---|
113 | |
---|
114 | LAL : asc lx1 papou1-fe hp2 #virgo-control1 |
---|
115 | @gmake done target=$@ |
---|
116 | LHCB : lxtest hpplus dxplus rsplus |
---|
117 | @gmake done target=$@ |
---|
118 | Atlas : atlinux atlas50 |
---|
119 | @gmake done target=$@ |
---|
120 | Virgo : ax7 vmpc13a rio0a |
---|
121 | @gmake done target=$@ |
---|
122 | CCIN2P3 : ccars ccahp ccali ccasn |
---|
123 | @gmake done target=$@ |
---|
124 | |
---|
125 | #--------------------------------------------------------- |
---|
126 | |
---|
127 | $(hosts) : |
---|
128 | $(remote_launch) $@ "sh -c '(cd $(PACKAGE_ROOT)/mgr; . setup.sh; $(MAKE) --no-print-directory $(MAKEFLAGS))'" |
---|
129 | |
---|
130 | $(BOOL_hosts) : |
---|
131 | $(remote_launch) $@ "zsh -c '(cd $(PACKAGE_ROOT)/mgr; . setup.sh; $(MAKE) --no-print-directory cppflags=-D_BOOL $(MAKEFLAGS))'" |
---|
132 | |
---|
133 | $(gmake_hosts) : |
---|
134 | $(remote_launch) $@ "sh -c '(cd $(PACKAGE_ROOT)/mgr; . setup.sh; gmake $(MAKEFLAGS))'" |
---|
135 | |
---|
136 | $(zsh_hosts) : |
---|
137 | $(remote_launch) $@ "zsh -c '(cd $(PACKAGE_ROOT)/mgr; . setup.sh; gmake $(MAKEFLAGS))'" |
---|
138 | |
---|
139 | $(make_hosts) : |
---|
140 | $(remote_launch) $@ "sh -c '(cd $(PACKAGE_ROOT)/mgr; . setup.sh; make $(MAKEFLAGS))'" |
---|
141 | #--------------------------------------------------------- |
---|
142 | |
---|
143 | |
---|
144 | CFLAGS = |
---|
145 | clinkflags = |
---|
146 | |
---|
147 | #--------------------------------------------------------- |
---|
148 | all :: cmt done |
---|
149 | @echo all ok |
---|
150 | @cd $(bin); /bin/rm -f cmt; cp cmt.exe cmt |
---|
151 | |
---|
152 | cmt_install_action = echo |
---|
153 | cmt_uninstall_action = echo |
---|
154 | CMTINSTALLAREA = |
---|
155 | |
---|
156 | include cmt.make |
---|
157 | #--------------------------------------------------------- |
---|
158 | |
---|
159 | #--------------------------------------------------------- |
---|
160 | # This procedure installs a hook into the commitinfo management file. |
---|
161 | # then the |
---|
162 | #--------------------------------------------------------- |
---|
163 | installcvs : |
---|
164 | cd `echo ${CVSROOT} | cut -f4 -d':'`/CVSROOT;\ |
---|
165 | if [ "`grep cmt_buildcvsinfos loginfo`" = "" ] ; then \ |
---|
166 | echo "======== Configuring loginfo in `pwd`>>>>>> "; \ |
---|
167 | chmod u+w loginfo; \ |
---|
168 | echo '.cmtcvsinfos $${CVSROOT}/CVSROOT/cmt_buildcvsinfos2.sh' >> loginfo; \ |
---|
169 | chmod u-w loginfo; \ |
---|
170 | else \ |
---|
171 | echo "======== loginfo already configured in `pwd` >>>>>> "; \ |
---|
172 | fi; \ |
---|
173 | cp ${CMTROOT}/mgr/cmt_buildcvsinfos2.sh .; \ |
---|
174 | /bin/rm -rf ../.cmtcvsinfos/* |
---|
175 | |
---|
176 | #--------------------------------------------------------- |
---|
177 | |
---|
178 | #--------------------------------------------------------- |
---|
179 | ###binaries = Linux OSF1 HP-UX VisualC |
---|
180 | ##binaries = $(shell '/usr/bin/find ../ -name cmt.exe') |
---|
181 | |
---|
182 | doxygen :: |
---|
183 | . /lal/Doxygen/Linux/setup.sh; cd ../doc; /bin/rm -Rf Doxygen; doxygen |
---|
184 | ${CMTROOT}/mgr/cmt_export.sh CMT/ ${CMTROOT}/doc/Doxygen |
---|
185 | |
---|
186 | pdf :: |
---|
187 | html2ps -nu -o ../doc/CMTDoc.ps ../doc/CMTDoc.html |
---|
188 | ps2pdf ../doc/CMTDoc.ps ../doc/CMTDoc.pdf |
---|
189 | html2ps -nu -o ../doc/CMTFAQ.ps ../doc/CMTFAQ.html |
---|
190 | ps2pdf ../doc/CMTFAQ.ps ../doc/CMTFAQ.pdf |
---|
191 | |
---|
192 | python = /afs/cern.ch/sw/lcg/external/Python/2.2.2/rh73_gcc32/bin/python2.2 |
---|
193 | |
---|
194 | gendoc :: |
---|
195 | @cd ../doc; $(python) gendoc.py CMTDoc.xml >|CMTDoc.html |
---|
196 | @echo "CMTDoc.html generated from CMTDoc.xml" |
---|
197 | |
---|
198 | |
---|
199 | docs :: |
---|
200 | ${CMTROOT}/mgr/cmt_export.sh CMT/ ${CMTROOT}/doc/index.html |
---|
201 | ${CMTROOT}/mgr/cmt_export.sh CMT/ ${CMTROOT}/doc/table.html |
---|
202 | ${CMTROOT}/mgr/cmt_export.sh CMT/ ${CMTROOT}/doc/intro.html |
---|
203 | ${CMTROOT}/mgr/cmt_export.sh CMT/ ${CMTROOT}/doc/projectmanagement.html |
---|
204 | ${CMTROOT}/mgr/cmt_export.sh CMT/ ${CMTROOT}/doc/copyright.html |
---|
205 | ${CMTROOT}/mgr/cmt_export.sh CMT/ ${CMTROOT}/doc/documents.html |
---|
206 | ${CMTROOT}/mgr/cmt_export.sh CMT/ ${CMTROOT}/doc/discussion.html |
---|
207 | ${CMTROOT}/mgr/cmt_export.sh CMT/ ${CMTROOT}/doc/repository.html |
---|
208 | ${CMTROOT}/mgr/cmt_export.sh CMT/ ${CMTROOT}/doc/download.html |
---|
209 | ${CMTROOT}/mgr/cmt_export.sh CMT/ ${CMTROOT}/doc/install.html |
---|
210 | ${CMTROOT}/mgr/cmt_export.sh CMT/ ${CMTROOT}/doc/CMTDoc.html |
---|
211 | ${CMTROOT}/mgr/cmt_export.sh CMT/ ${CMTROOT}/doc/CMTDoc.ps |
---|
212 | ${CMTROOT}/mgr/cmt_export.sh CMT/ ${CMTROOT}/doc/CMTDoc.pdf |
---|
213 | ${CMTROOT}/mgr/cmt_export.sh CMT/ ${CMTROOT}/doc/CMTFAQ.html |
---|
214 | ${CMTROOT}/mgr/cmt_export.sh CMT/ ${CMTROOT}/doc/ReleaseNotes.html |
---|
215 | ${CMTROOT}/mgr/cmt_export.sh CMT/ ${CMTROOT}/ChangeLog |
---|
216 | ${CMTROOT}/mgr/cmt_export.sh CMT/ ${CMTROOT}/mgr/ChangeLog.php |
---|
217 | ${CMTROOT}/mgr/cmt_export.sh CMT/ ${CMTROOT}/doc/CMTFAQ.ps |
---|
218 | ${CMTROOT}/mgr/cmt_export.sh CMT/ ${CMTROOT}/doc/CMTFAQ.pdf |
---|
219 | |
---|
220 | bintar :: docs |
---|
221 | cd ..; root=`pwd`; \ |
---|
222 | tag=`cmt version`; \ |
---|
223 | version=`basename $${root}`; \ |
---|
224 | tag=$${version} ; \ |
---|
225 | package=`dirname $${root}`; \ |
---|
226 | package=`basename $${package}`; \ |
---|
227 | cat doc/CMTDownload1.html >| doc/CMTDownload.html; \ |
---|
228 | echo ' <tr><td><a href="CMT'$${version}'.tar.gz">Source kit</a> </td></tr>' >> doc/CMTDownload.html; \ |
---|
229 | binaries=`/usr/bin/find ./ -name cmt.exe | sed -e 's#[.]/##' -e 's#/.*##'`; \ |
---|
230 | for f in `echo $${binaries}`; do \ |
---|
231 | echo ' <tr><td><a href="CMT'$${version}$${f}'.tar.gz">'$${f}'</a> </td></tr>' >> doc/CMTDownload.html; \ |
---|
232 | done; \ |
---|
233 | echo ' <tr><td><a href="CMT-'$${version}'-1.i386.rpm">RPM for redhat 7.2</a></td></tr>' >> doc/CMTDownload.html; \ |
---|
234 | cat doc/CMTDownload2.html >> doc/CMTDownload.html; \ |
---|
235 | ${CMTROOT}/mgr/cmt_export.sh $${package}/ $${root}/doc/CMTDownload.html $${tag}; \ |
---|
236 | ${CMTROOT}/mgr/cmt_export.sh $${package}/ $${root}/rpm/CMT-$${version}-1.i386.rpm $${tag}; \ |
---|
237 | cd ../../; \ |
---|
238 | for branch in `echo $${binaries}` ; \ |
---|
239 | do \ |
---|
240 | echo $${branch} ; \ |
---|
241 | tarfile=$${package}/$${package}$${version}$${branch}.tar; \ |
---|
242 | tar cf $${tarfile} $${package}/$${version}/$${branch} ; \ |
---|
243 | gzip $${tarfile}; \ |
---|
244 | ${CMTROOT}/mgr/cmt_export.sh $${package}/ $${tarfile}.gz $${tag} ; \ |
---|
245 | done |
---|
246 | |
---|
247 | |
---|
248 | bins : |
---|
249 | |
---|
250 | |
---|
251 | |
---|
252 | #---------------------------------------------------------- |
---|
253 | # |
---|
254 | # Building an RPM for CMT. |
---|
255 | # |
---|
256 | # reinstallation is done by: |
---|
257 | # |
---|
258 | # rpm -Uvh --relocate /CMT=/newdir/CMT CMT-${version}-1.i386.rpm |
---|
259 | # |
---|
260 | #---------------------------------------------------------- |
---|
261 | rpm :: |
---|
262 | version=`$(cmtexe) version`; \ |
---|
263 | tempdir=/tmp/CMT; \ |
---|
264 | rm -rf $${tempdir}; \ |
---|
265 | for f in BUILD RPMS SOURCES SPECS SRPMS ; do \ |
---|
266 | mkdir -p $${tempdir}/$${f}; \ |
---|
267 | done; \ |
---|
268 | (cd ../; tar cf $${tempdir}/SOURCES/CMT$${version}.tar --exclude CVS fragments mgr src); \ |
---|
269 | gzip $${tempdir}/SOURCES/CMT$${version}.tar; \ |
---|
270 | rpm -ba --define "_topdir $${tempdir}" --define "_version $${version}" CMT.spec; \ |
---|
271 | if test ! -d ../rpm; then mkdir -p ../rpm; fi; \ |
---|
272 | cp $${tempdir}/RPMS/i386/CMT-$${version}-1.i386.rpm ../rpm ; \ |
---|
273 | cp $${tempdir}/SRPMS/CMT-$${version}-1.src.rpm ../rpm ; \ |
---|
274 | rm -r $${tempdir} |
---|
275 | |
---|
276 | srctar :: |
---|
277 | ${CMTROOT}/mgr/cmt_tar_export.sh CVS mgr src fragments Linux Visual grafviz java doc |
---|
278 | |
---|
279 | |
---|
280 | Export :: srctar bintar |
---|
281 | @echo Export done |
---|
282 | |
---|
283 | democlean :: |
---|
284 | /bin/rm -rf ../demo/* |
---|
285 | |
---|
286 | demo_location = ../demo |
---|
287 | demo_sequence = demo1 |
---|
288 | |
---|
289 | demo :: democlean |
---|
290 | @echo "------------------------------------------" |
---|
291 | @echo "Starting general auto test sequence" |
---|
292 | @echo " Creating $(demo_location) work area..." |
---|
293 | @mkdir -p $(demo_location) |
---|
294 | @echo " Creating all $(demo_sequence) packages..." |
---|
295 | cd $(demo_location); \ |
---|
296 | version=`$(cmtexe) version`; \ |
---|
297 | ($(cmtexe) run_sequence ${CMTROOT}/src/demo/$(demo_sequence).cmt | \ |
---|
298 | sed -e "s#$${CMTROOT}#"'$${CMTROOT}'"#" \ |
---|
299 | -e "s#$${version}#"'$${version}'"#" \ |
---|
300 | -e "s#$${CMTCONFIG}#"'$${CMTCONFIG}'"#"; \ |
---|
301 | ) >$(demo_sequence).txt |
---|
302 | @echo " Comparing results with reference output (${CMTROOT}/src/demo/$(demo_sequence).out) ..." |
---|
303 | @cd $(demo_location); \ |
---|
304 | diff $(demo_sequence).txt ${CMTROOT}/src/demo/$(demo_sequence).out; s=$$?; \ |
---|
305 | if test $${s} = 0; then \ |
---|
306 | echo " => no differences"; \ |
---|
307 | else \ |
---|
308 | echo " => errors?"; \ |
---|
309 | cp $(demo_sequence).txt ${CMTROOT}/src/demo/$(demo_sequence).out; \ |
---|
310 | fi |
---|
311 | |
---|
312 | #--------------------------------------------------------- |
---|
313 | |
---|
314 | |
---|
315 | tprivate :: democlean |
---|
316 | @echo "------------------------------------------"; \ |
---|
317 | sequence=tprivate; \ |
---|
318 | location=../demo; \ |
---|
319 | echo "Starting auto test sequence on private uses"; \ |
---|
320 | echo " Creating $${location} work area..."; \ |
---|
321 | mkdir -p $${location}; \ |
---|
322 | cd $${location}; \ |
---|
323 | version=`$(cmtexe) version`; \ |
---|
324 | echo " Creating all $${sequence} packages..."; \ |
---|
325 | ($(cmtexe) run_sequence ${CMTROOT}/src/demo/$${sequence}.cmt | \ |
---|
326 | sed -e "s#$${CMTROOT}#"'$${CMTROOT}'"#" \ |
---|
327 | -e "s#$${version}#"'$${version}'"#" \ |
---|
328 | -e "s#$${CMTCONFIG}#"'$${CMTCONFIG}'"#"; \ |
---|
329 | ) >$${sequence}.txt; \ |
---|
330 | echo " Comparing results with reference output (${CMTROOT}/src/demo/$${sequence}.out) ..."; \ |
---|
331 | diff $${sequence}.txt ${CMTROOT}/src/demo/$${sequence}.out; s=$$?; \ |
---|
332 | if test $${s} = 0; then \ |
---|
333 | echo " => no differences"; \ |
---|
334 | else \ |
---|
335 | echo " => errors?"; \ |
---|
336 | cp $${sequence}.txt ${CMTROOT}/src/demo/$${sequence}.out; \ |
---|
337 | fi |
---|
338 | |
---|
339 | |
---|
340 | |
---|
341 | #--------------------------------------------------------- |
---|
342 | |
---|
343 | help :: |
---|
344 | @echo "------------------------------------------------------------" |
---|
345 | @echo " [all] : Default target" |
---|
346 | @echo " " |
---|
347 | @echo " installcvs : " |
---|
348 | @echo " doxygen : Documentation generation" |
---|
349 | @echo " docs : Documentation production and installation" |
---|
350 | @echo " pdf : Convert html docs into pdf and ps" |
---|
351 | @echo " gendoc : Convert xml doc into html" |
---|
352 | @echo " srctar : Production and installation of source tar-ball" |
---|
353 | @echo " (include Linux binary directory)" |
---|
354 | @echo " bintar : Production and installation of binary tar-balls" |
---|
355 | @echo " rpm : Production of the RPM" |
---|
356 | @echo " Export : Installation in the web site" |
---|
357 | @echo " democlean : Cleaning the demo area" |
---|
358 | @echo " demo : Run the demo sequence on private uses" |
---|
359 | @echo " (Site-specific targets for building CMT)" |
---|
360 | @echo " LAL : asc lx1 papou1-fe hp2 #virgo-control1" |
---|
361 | @echo " LHCB : lxtest hpplus dxplus rsplus" |
---|
362 | @echo " Atlas : atlinux atlas50" |
---|
363 | @echo " Virgo : ax7 vmpc13a rio0a" |
---|
364 | @echo " CCIN2P3 : ccars ccahp ccali ccasn" |
---|
365 | @echo "------------------------------------------------------------" |
---|
366 | |
---|