source: CMT/v1r25p20140131/mgr/Makefile

Last change on this file was 328, checked in by garonne, 18 years ago

Sauvegarde

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