source: CMT/v1r19/mgr/Makefile

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

fixed bug

  • 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 :
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
124include cmt.make
125
126post_build :: cmt_dependencies.make $(bin)/cmt_dependencies.make
127        echo post_build done
128
129cmt_dependencies.make $(bin)/cmt_dependencies.make : $(cmtexe)
130        $(cmtexe) -quiet build dependencies cmt -all_sources -no_stamps
131        cp $(bin)/cmt_dependencies.make ../mgr
132        $(cmtexe) -quiet build dependencies cmt -all_sources
133
134#---------------------------------------------------------
135
136#---------------------------------------------------------
137# This procedure installs a hook into the commitinfo management file.
138# then the
139#---------------------------------------------------------
140installcvs :
141        cd `echo ${CVSROOT} | cut -f4 -d':'`/CVSROOT;\
142        if [ "`grep cmt_buildcvsinfos loginfo`" = "" ] ; then \
143          echo "======== Configuring loginfo in `pwd`>>>>>> "; \
144          chmod u+w loginfo; \
145          echo '.cmtcvsinfos $${CVSROOT}/CVSROOT/cmt_buildcvsinfos2.sh' >> loginfo; \
146          chmod u-w loginfo; \
147        else \
148          echo "======== loginfo already configured in `pwd` >>>>>> "; \
149        fi; \
150        cp ${CMTROOT}/mgr/cmt_buildcvsinfos2.sh .; \
151        /bin/rm -rf ../.cmtcvsinfos/*
152
153#---------------------------------------------------------
154
155#---------------------------------------------------------
156###binaries = Linux OSF1 HP-UX VisualC
157##binaries = $(shell '/usr/bin/find ../ -name cmt.exe')
158
159
160#---------------------------------------------------------
161# Regenerates the Doxygen documentation of CMT
162# A priori as it is written it works at LAL only
163# The result is also transported to the Web site
164#---------------------------------------------------------
165doxygen ::
166        . /lal/Doxygen/Linux/setup.sh; cd ../doc; /bin/rm -Rf Doxygen; doxygen
167        ${CMTROOT}/mgr/cmt_export.sh CMT/ ${CMTROOT}/doc/Doxygen
168
169#---------------------------------------------------------
170# Converts CMTDoc.html CMTFAQ.html into pdf and ps
171#---------------------------------------------------------
172pdf ::
173        html2ps -nu -o ../doc/CMTDoc.ps ../doc/CMTDoc.html
174        ps2pdf ../doc/CMTDoc.ps ../doc/CMTDoc.pdf
175        html2ps -nu -o ../doc/CMTFAQ.ps ../doc/CMTFAQ.html
176        ps2pdf ../doc/CMTFAQ.ps ../doc/CMTFAQ.pdf
177
178#python = python
179python = /afs/cern.ch/sw/lcg/external/Python/2.3.4/rh73_gcc323/bin/python
180#python = /cygdrive/c/Arnault/Python23/python.exe
181
182#---------------------------------------------------------
183# Generates the html form of the doc from the XML form
184#---------------------------------------------------------
185gendoc ::
186        @cd ../doc; python gendoc.py CMTDoc.xml > CMTDoc.html
187        @echo "CMTDoc.html generated from CMTDoc.xml"
188
189
190#---------------------------------------------------------
191# Transfer the docs into the Web site.
192#---------------------------------------------------------
193docs ::
194        ${CMTROOT}/mgr/cmt_export.sh CMT/ ${CMTROOT}/doc/CMTDoc.html
195        ${CMTROOT}/mgr/cmt_export.sh CMT/ ${CMTROOT}/doc/CMTDoc.ps
196        ${CMTROOT}/mgr/cmt_export.sh CMT/ ${CMTROOT}/doc/CMTDoc.pdf
197        ${CMTROOT}/mgr/cmt_export.sh CMT/ ${CMTROOT}/doc/CMTFAQ.html
198        ${CMTROOT}/mgr/cmt_export.sh CMT/ ${CMTROOT}/doc/ReleaseNotes.html
199        ${CMTROOT}/mgr/cmt_export.sh CMT/ ${CMTROOT}/ChangeLog
200        ${CMTROOT}/mgr/cmt_export.sh CMT/ ${CMTROOT}/mgr/ChangeLog.php
201        ${CMTROOT}/mgr/cmt_export.sh CMT/ ${CMTROOT}/doc/CMTFAQ.ps
202        ${CMTROOT}/mgr/cmt_export.sh CMT/ ${CMTROOT}/doc/CMTFAQ.pdf
203
204#        echo '  <tr><td><a href="CMT-'$${version}'-1.i386.rpm">RPM for redhat 7.2</a></td></tr>' >>doc/CMTDownload.html;
205
206#---------------------------------------------------------
207# Construct the pacman file from the generic form
208#---------------------------------------------------------
209pacman ::
210        version=`cmt version`; \
211        sed -e 's#<version>#'"$${version}"'#g' CMT.pacman >CMT-$${version}.pacman
212
213#---------------------------------------------------------
214# Construct the tar balls for the binary kits for all
215# existing binaries available in ../*.cmt.exe
216# Binary kits are now autonomous (ie they don't require
217# the source kit)
218#---------------------------------------------------------
219bintar ::
220        cd ..; root=`pwd`; \
221        tag=`cmt version`; \
222        version=`basename $${root}`; \
223        tag=$${version} ; \
224        cat doc/CMTDownload1.html >| doc/CMTDownload.html; \
225        echo '  <tr><td><a href="CMT'$${version}'.tar.gz">Source kit</a> </td></tr>' >> doc/CMTDownload.html; \
226        binaries=`/usr/bin/find ./ -name cmt.exe | sed -e 's#[.]/##' -e 's#/.*##'`; \
227        for f in `echo $${binaries}`; do \
228          echo '  <tr><td><a href="CMT'$${version}$${f}'.tar.gz">'$${f}'</a> </td></tr>' >> doc/CMTDownload.html; \
229        done; \
230        cat doc/CMTDownload2.html >> doc/CMTDownload.html; \
231        ${CMTROOT}/mgr/cmt_export.sh CMT/ $${root}/doc/CMTDownload.html $${tag}; \
232        if test -d rpm; then \
233          ${CMTROOT}/mgr/cmt_export.sh CMT/ $${root}/rpm/CMT-$${version}-1.i386.rpm $${tag}; \
234        fi; \
235        cd ../../; \
236        for branch in `echo $${binaries}` ; \
237        do \
238          if test $${branch} = VisualC; then \
239            /bin/rm -rf CMT/$${version}/$${branch}/cmt ; \
240          else \
241            /bin/rm -rf CMT/$${version}/$${branch}/*.o ; \
242            ln -s cmt.exe CMT/$${version}/$${branch}/cmt ; \
243          fi ; \
244          echo $${branch} ; \
245          tarfile=CMT/CMT$${version}$${branch}.tar; \
246          tar cf $${tarfile} CMT/$${version}/mgr CMT/$${version}/src CMT/$${version}/$${branch} ; \
247          gzip $${tarfile}; \
248          ${CMTROOT}/mgr/cmt_export.sh CMT/ $${tarfile}.gz $${tag} ; \
249        done
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#----------------------------------------------------------
261rpm ::
262        version=`$(cmtexe) -quiet 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 mgr src source); \
269        gzip $${tempdir}/SOURCES/CMT$${version}.tar; \
270        if test ! -d ../rpm; then mkdir -p ../rpm; fi; \
271        rpmbuild -ba --define "_topdir $${tempdir}" --define "_version $${version}" CMT.spec; \
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#
277#        cp CMT.spec $${tempdir}; \
278#        find ../fragments ../mgr ../src ! -path '*/CVS*' ! -name '*~' ! -type d | \
279#          sed -e 's#[.][.]#%{prefix}/%{version}#' >>$${tempdir}/CMT.spec ; \
280#
281
282
283#----------------------------------------------------------
284# Construct a source kit
285#----------------------------------------------------------
286srctar ::
287        ${CMTROOT}/mgr/cmt_tar_export.sh source mgr src Visual java doc
288
289
290#----------------------------------------------------------
291# Construct the kits
292#----------------------------------------------------------
293Export :: docs srctar bintar
294        @echo Export done
295
296democlean ::
297        /bin/rm -rf ../demo/*
298
299demo_location = ../demo
300demo_sequence = demo1
301
302#----------------------------------------------------------
303# Run the autotest sequence
304#----------------------------------------------------------
305demo :: democlean
306        @echo "------------------------------------------"
307        @echo "Starting general auto test sequence"
308        @echo "  Creating $(demo_location) work area..."
309        @mkdir -p $(demo_location)
310        @echo "  Creating all $(demo_sequence) packages..."
311        cd $(demo_location); \
312        version=`$(cmtexe) -quiet version`; \
313        ($(cmtexe) -quiet run_sequence ${CMTROOT}/src/demo/$(demo_sequence).cmt | \
314          sed -e "s#$${CMTROOT}#"'$${CMTROOT}'"#" \
315              -e "s#$${version}#"'$${version}'"#" \
316              -e "s#$${CMTCONFIG}#"'$${CMTCONFIG}'"#"; \
317          ) >$(demo_sequence).txt
318        @echo "  Comparing results with reference output (${CMTROOT}/src/demo/$(demo_sequence).out) ..."
319        @cd $(demo_location); \
320        diff $(demo_sequence).txt ${CMTROOT}/src/demo/$(demo_sequence).out; s=$$?; \
321        if test $${s} = 0; then \
322          echo "    => no differences"; \
323        else \
324          echo "    => errors?"; \
325          cp $(demo_sequence).txt ${CMTROOT}/src/demo/$(demo_sequence).out; \
326        fi
327
328#---------------------------------------------------------
329
330
331tprivate :: democlean
332        @echo "------------------------------------------"; \
333        sequence=tprivate; \
334        location=../demo; \
335        echo "Starting auto test sequence on private uses"; \
336        echo "  Creating $${location} work area..."; \
337        mkdir -p $${location}; \
338        cd $${location}; \
339        version=`$(cmtexe) -quiet version`; \
340        echo "  Creating all $${sequence} packages..."; \
341        ($(cmtexe) -quiet run_sequence ${CMTROOT}/src/demo/$${sequence}.cmt | \
342          sed -e "s#$${CMTROOT}#"'$${CMTROOT}'"#" \
343              -e "s#$${version}#"'$${version}'"#" \
344              -e "s#$${CMTCONFIG}#"'$${CMTCONFIG}'"#"; \
345          ) >$${sequence}.txt; \
346        echo "  Comparing results with reference output (${CMTROOT}/src/demo/$${sequence}.out) ..."; \
347        diff $${sequence}.txt ${CMTROOT}/src/demo/$${sequence}.out; s=$$?; \
348        if test $${s} = 0; then \
349          echo "    => no differences"; \
350        else \
351          echo "    => errors?"; \
352          cp $${sequence}.txt ${CMTROOT}/src/demo/$${sequence}.out; \
353        fi
354
355
356
357#---------------------------------------------------------
358
359help ::
360        @echo "------------------------------------------------------------"
361        @echo "  [all]      : Default target"
362        @echo "  "
363        @echo "  installcvs : "
364        @echo "  doxygen    : Documentation generation"
365        @echo "  docs       : Documentation production and installation"
366        @echo "  pdf        : Convert html docs into pdf and ps"
367        @echo "  gendoc     : Convert xml doc into html"
368        @echo "  srctar     : Production and installation of source tar-ball"
369        @echo "                (include Linux binary directory)"
370        @echo "  bintar     : Production and installation of binary tar-balls"
371        @echo "  rpm        : Production of the RPM"
372        @echo "  Export     : Installation in the web site"
373        @echo "  democlean  : Cleaning the demo area"
374        @echo "  demo       : Run the demo sequence on private uses"
375        @echo "      (Site-specific targets for building CMT)"
376        @echo "  LAL        : asc lx1 papou1-fe hp2 #virgo-control1"
377        @echo "  LHCB       : lxtest hpplus dxplus rsplus"
378        @echo "  Atlas      : atlinux atlas50"
379        @echo "  Virgo      : ax7 vmpc13a rio0a"
380        @echo "  CCIN2P3    : ccars ccahp ccali ccasn"
381        @echo "------------------------------------------------------------"
382
Note: See TracBrowser for help on using the repository browser.