source: CMT/HEAD/mgr/Makefile @ 45

Last change on this file since 45 was 45, checked in by arnault, 19 years ago

cmt cvs operations - See CL 272

  • Property svn:eol-style set to native
File size: 12.2 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
67
68cppcomp   = $(cpp) -c -I${inc} $(cppflags)
69cpplink   = $(cpp)
70
71src       = ../src/
72inc       = ../src/
73mgr       = ../mgr/
74bin       = ../${CMTBIN}/
75binshort  = ../${CMTBIN}
76
77cpp_silent =
78cpp_echo = @--->
79link_silent =
80link_echo = @--->
81
82SHELL     = /bin/sh
83
84tag       = 
85
86application_suffix = .exe
87cmtexe    = $(CMTROOT)/$(CMTBIN)/cmt.exe
88
89build_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 
90
91PACKAGE_ROOT = ${CMTROOT}
92
93all :: dirs
94        -@cd $(bin); /bin/rm -f last-rebuild; date >last-rebuild
95
96dirs ::
97        @if test ! -d $(bin) ; then mkdir -p $(binshort) ; fi
98
99#---------------------------------------------------------
100#
101# Re-building CMT
102#
103#---------------------------------------------------------
104
105done :
106        @echo "CMT has been succesfully rebuilt."
107
108CFLAGS = 
109clinkflags = 
110
111#---------------------------------------------------------
112all :: cmt post_build done
113        @cd $(bin); /bin/rm -f cmt; cp cmt.exe cmt
114        @echo all ok
115
116cmt_install_action = echo
117cmt_uninstall_action = echo
118CMTINSTALLAREA = 
119
120include cmt.make
121
122post_build :: cmt_dependencies.make $(bin)/cmt_dependencies.make
123        echo post_build done
124
125cmt_dependencies.make $(bin)/cmt_dependencies.make : $(cmtexe)
126        $(cmtexe) build dependencies cmt -all_sources -no_stamps
127        cp $(bin)/cmt_dependencies.make ../mgr
128        $(cmtexe) build dependencies cmt -all_sources
129
130#---------------------------------------------------------
131
132#---------------------------------------------------------
133# This procedure installs a hook into the commitinfo management file.
134# then the
135#---------------------------------------------------------
136installcvs :
137        cd `echo ${CVSROOT} | cut -f4 -d':'`/CVSROOT;\
138        if [ "`grep cmt_buildcvsinfos loginfo`" = "" ] ; then \
139          echo "======== Configuring loginfo in `pwd`>>>>>> "; \
140          chmod u+w loginfo; \
141          echo '.cmtcvsinfos $${CVSROOT}/CVSROOT/cmt_buildcvsinfos2.sh' >> loginfo; \
142          chmod u-w loginfo; \
143        else \
144          echo "======== loginfo already configured in `pwd` >>>>>> "; \
145        fi; \
146        cp ${CMTROOT}/mgr/cmt_buildcvsinfos2.sh .; \
147        /bin/rm -rf ../.cmtcvsinfos/*
148
149#---------------------------------------------------------
150
151#---------------------------------------------------------
152###binaries = Linux OSF1 HP-UX VisualC
153##binaries = $(shell '/usr/bin/find ../ -name cmt.exe')
154
155
156#---------------------------------------------------------
157# Regenerates the Doxygen documentation of CMT
158# A priori as it is written it works at LAL only
159# The result is also transported to the Web site
160#---------------------------------------------------------
161doxygen ::
162        . /lal/Doxygen/Linux/setup.sh; cd ../doc; /bin/rm -Rf Doxygen; doxygen
163        ${CMTROOT}/mgr/cmt_export.sh CMT/ ${CMTROOT}/doc/Doxygen
164
165#---------------------------------------------------------
166# Converts CMTDoc.html CMTFAQ.html into pdf and ps
167#---------------------------------------------------------
168pdf ::
169        html2ps -nu -o ../doc/CMTDoc.ps ../doc/CMTDoc.html
170        ps2pdf ../doc/CMTDoc.ps ../doc/CMTDoc.pdf
171        html2ps -nu -o ../doc/CMTFAQ.ps ../doc/CMTFAQ.html
172        ps2pdf ../doc/CMTFAQ.ps ../doc/CMTFAQ.pdf
173
174python = /afs/cern.ch/sw/lcg/external/Python/2.2.2/rh73_gcc32/bin/python2.2
175python = /cygdrive/c/Arnault/Python23/python.exe
176
177#---------------------------------------------------------
178# Generates the html form of the doc from the XML form
179#---------------------------------------------------------
180gendoc ::
181        @cd ../doc; $(python) gendoc.py CMTDoc.xml > CMTDoc.html
182        @echo "CMTDoc.html generated from CMTDoc.xml"
183
184
185#---------------------------------------------------------
186# Transfer the docs into the Web site.
187#---------------------------------------------------------
188docs ::
189        ${CMTROOT}/mgr/cmt_export.sh CMT/ ${CMTROOT}/doc/index.html
190        ${CMTROOT}/mgr/cmt_export.sh CMT/ ${CMTROOT}/doc/table.html
191        ${CMTROOT}/mgr/cmt_export.sh CMT/ ${CMTROOT}/doc/intro.html
192        ${CMTROOT}/mgr/cmt_export.sh CMT/ ${CMTROOT}/doc/projectmanagement.html
193        ${CMTROOT}/mgr/cmt_export.sh CMT/ ${CMTROOT}/doc/copyright.html
194        ${CMTROOT}/mgr/cmt_export.sh CMT/ ${CMTROOT}/doc/documents.html
195        ${CMTROOT}/mgr/cmt_export.sh CMT/ ${CMTROOT}/doc/discussion.html
196        ${CMTROOT}/mgr/cmt_export.sh CMT/ ${CMTROOT}/doc/repository.html
197        ${CMTROOT}/mgr/cmt_export.sh CMT/ ${CMTROOT}/doc/download.html
198        ${CMTROOT}/mgr/cmt_export.sh CMT/ ${CMTROOT}/doc/install.html
199        ${CMTROOT}/mgr/cmt_export.sh CMT/ ${CMTROOT}/doc/CMTDoc.html
200        ${CMTROOT}/mgr/cmt_export.sh CMT/ ${CMTROOT}/doc/CMTDoc.ps
201        ${CMTROOT}/mgr/cmt_export.sh CMT/ ${CMTROOT}/doc/CMTDoc.pdf
202        ${CMTROOT}/mgr/cmt_export.sh CMT/ ${CMTROOT}/doc/CMTFAQ.html
203        ${CMTROOT}/mgr/cmt_export.sh CMT/ ${CMTROOT}/doc/ReleaseNotes.html
204        ${CMTROOT}/mgr/cmt_export.sh CMT/ ${CMTROOT}/ChangeLog
205        ${CMTROOT}/mgr/cmt_export.sh CMT/ ${CMTROOT}/mgr/ChangeLog.php
206        ${CMTROOT}/mgr/cmt_export.sh CMT/ ${CMTROOT}/doc/CMTFAQ.ps
207        ${CMTROOT}/mgr/cmt_export.sh CMT/ ${CMTROOT}/doc/CMTFAQ.pdf
208
209#        echo '  <tr><td><a href="CMT-'$${version}'-1.i386.rpm">RPM for redhat 7.2</a></td></tr>' >>doc/CMTDownload.html;
210
211#---------------------------------------------------------
212# Construct the pacman file from the generic form
213#---------------------------------------------------------
214pacman ::
215        version=`cmt version`; \
216        sed -e 's#<version>#'"$${version}"'#g' CMT.pacman >CMT-$${version}.pacman
217
218#---------------------------------------------------------
219# Construct the tar balls for the binary kits for all
220# existing binaries available in ../*.cmt.exe
221# Binary kits are now autonomous (ie they don't require
222# the source kit)
223#---------------------------------------------------------
224bintar :: docs
225        cd ..; root=`pwd`; \
226        tag=`cmt version`; \
227        version=`basename $${root}`; \
228        tag=$${version} ; \
229        package=`dirname $${root}`; \
230        package=`basename $${package}`; \
231        cat doc/CMTDownload1.html >| doc/CMTDownload.html; \
232        echo '  <tr><td><a href="CMT'$${version}'.tar.gz">Source kit</a> </td></tr>' >> doc/CMTDownload.html; \
233        binaries=`/usr/bin/find ./ -name cmt.exe | sed -e 's#[.]/##' -e 's#/.*##'`; \
234        for f in `echo $${binaries}`; do \
235          echo '  <tr><td><a href="CMT'$${version}$${f}'.tar.gz">'$${f}'</a> </td></tr>' >> doc/CMTDownload.html; \
236        done; \
237        cat doc/CMTDownload2.html >> doc/CMTDownload.html; \
238        ${CMTROOT}/mgr/cmt_export.sh $${package}/ $${root}/doc/CMTDownload.html $${tag}; \
239        if test -d rpm; then \
240          ${CMTROOT}/mgr/cmt_export.sh $${package}/ $${root}/rpm/CMT-$${version}-1.i386.rpm $${tag}; \
241        fi; \
242        cd ../../; \
243        for branch in `echo $${binaries}` ; \
244        do \
245          echo $${branch} ; \
246          tarfile=$${package}/$${package}$${version}$${branch}.tar; \
247          tar cf $${tarfile} $${package}/$${version}/mgr $${package}/$${version}/src $${package}/$${version}/$${branch} ; \
248          gzip $${tarfile}; \
249          ${CMTROOT}/mgr/cmt_export.sh $${package}/ $${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) 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 CVS 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 CVS source mgr src Visual grafviz java doc
289
290
291#----------------------------------------------------------
292# Construct the kits
293#----------------------------------------------------------
294Export :: 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) version`; \
314        ($(cmtexe) 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) version`; \
341        echo "  Creating all $${sequence} packages..."; \
342        ($(cmtexe) 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.