[2] | 1 | |
---|
| 2 | cppflags = $(CFLAGS) |
---|
| 3 | |
---|
[223] | 4 | |
---|
[2] | 5 | cpp = g++ -O2 |
---|
| 6 | |
---|
| 7 | ifeq ($(CMTBIN),LinuxDebug) |
---|
| 8 | cpp = g++ -g |
---|
| 9 | endif |
---|
| 10 | |
---|
| 11 | ifeq ($(CMTBIN),Linux-i686Debug) |
---|
| 12 | cpp = g++ -g |
---|
| 13 | endif |
---|
| 14 | |
---|
| 15 | ifeq ($(CMTBIN),LinuxProf) |
---|
| 16 | cpp = g++ -g -pg |
---|
[223] | 17 | endif |
---|
[2] | 18 | |
---|
| 19 | ifeq ($(CMTBIN),Linux-i686Prof) |
---|
| 20 | cpp = g++ -g -pg |
---|
| 21 | endif |
---|
| 22 | |
---|
[223] | 23 | |
---|
[2] | 24 | ifeq ($(CMTBIN),LinuxInsure) |
---|
| 25 | cpp = insure -g |
---|
| 26 | endif |
---|
| 27 | |
---|
| 28 | ifeq ($(CMTBIN),OSF1DEB) |
---|
| 29 | cpp = cxx -g3 -pg |
---|
| 30 | endif |
---|
| 31 | |
---|
| 32 | ifeq ($(CMTBIN),OSF1-alpha) |
---|
| 33 | cpp = cxx |
---|
| 34 | endif |
---|
| 35 | |
---|
| 36 | ifeq ($(CMTBIN),SunOS-sun4u) |
---|
| 37 | cpp = CC |
---|
| 38 | endif |
---|
| 39 | |
---|
| 40 | ifeq ($(CMTBIN),HP-UX) |
---|
| 41 | cpp = aCC |
---|
| 42 | endif |
---|
| 43 | |
---|
| 44 | ifeq ($(CMTBIN),Darwin) |
---|
| 45 | cpp = c++ -O2 |
---|
| 46 | endif |
---|
| 47 | |
---|
| 48 | #ifeq ($(CMTBIN),OSF1) |
---|
| 49 | #remote_launch = rsh |
---|
| 50 | #else |
---|
| 51 | remote_launch = ssh |
---|
| 52 | #endif |
---|
| 53 | |
---|
| 54 | ifeq ($(CMTBIN),CYGWIN_NT-5.1-i686) |
---|
| 55 | cpp = g++ -O2 -Wno-deprecated |
---|
[15] | 56 | cpp = g++ -g -Wno-deprecated |
---|
[2] | 57 | endif |
---|
| 58 | |
---|
| 59 | ifeq ($(CMTBIN),LynxOS-PowerPC) |
---|
| 60 | cpp = g++ |
---|
| 61 | endif |
---|
| 62 | |
---|
| 63 | ifeq ($(CMTBIN),AIX-002065204C00) |
---|
| 64 | cpp = g++ -O2 -Wno-deprecated |
---|
| 65 | endif |
---|
| 66 | |
---|
| 67 | cppcomp = $(cpp) -c -I${inc} $(cppflags) |
---|
[209] | 68 | |
---|
| 69 | ifeq ($(STATIC),1) |
---|
[223] | 70 | cpplink = $(cpp) -static |
---|
[209] | 71 | else |
---|
[223] | 72 | cpplink = $(cpp) |
---|
[209] | 73 | endif |
---|
[2] | 74 | |
---|
| 75 | src = ../src/ |
---|
| 76 | inc = ../src/ |
---|
| 77 | mgr = ../mgr/ |
---|
| 78 | bin = ../${CMTBIN}/ |
---|
| 79 | binshort = ../${CMTBIN} |
---|
| 80 | |
---|
| 81 | cpp_silent = |
---|
| 82 | cpp_echo = @---> |
---|
| 83 | link_silent = |
---|
| 84 | link_echo = @---> |
---|
| 85 | |
---|
| 86 | SHELL = /bin/sh |
---|
| 87 | |
---|
| 88 | tag = |
---|
| 89 | |
---|
| 90 | application_suffix = .exe |
---|
| 91 | cmtexe = $(CMTROOT)/$(CMTBIN)/cmt.exe |
---|
| 92 | |
---|
| 93 | build_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 | |
---|
| 95 | PACKAGE_ROOT = ${CMTROOT} |
---|
| 96 | |
---|
| 97 | all :: dirs |
---|
| 98 | -@cd $(bin); /bin/rm -f last-rebuild; date >last-rebuild |
---|
| 99 | |
---|
| 100 | dirs :: |
---|
| 101 | @if test ! -d $(bin) ; then mkdir -p $(binshort) ; fi |
---|
| 102 | |
---|
| 103 | #--------------------------------------------------------- |
---|
| 104 | # |
---|
| 105 | # Re-building CMT |
---|
| 106 | # |
---|
| 107 | #--------------------------------------------------------- |
---|
| 108 | |
---|
[328] | 109 | done : cmt post_build |
---|
[2] | 110 | @echo "CMT has been succesfully rebuilt." |
---|
| 111 | |
---|
| 112 | CFLAGS = |
---|
| 113 | clinkflags = |
---|
| 114 | |
---|
| 115 | #--------------------------------------------------------- |
---|
| 116 | all :: cmt post_build done |
---|
| 117 | @cd $(bin); /bin/rm -f cmt; cp cmt.exe cmt |
---|
| 118 | @echo all ok |
---|
| 119 | |
---|
| 120 | cmt_install_action = echo |
---|
| 121 | cmt_uninstall_action = echo |
---|
| 122 | CMTINSTALLAREA = |
---|
| 123 | |
---|
[328] | 124 | |
---|
[2] | 125 | include cmt.make |
---|
| 126 | |
---|
[328] | 127 | post_build :: cmt cmt_dependencies.make $(bin)/cmt_dependencies.make |
---|
[2] | 128 | echo post_build done |
---|
| 129 | |
---|
| 130 | cmt_dependencies.make $(bin)/cmt_dependencies.make : $(cmtexe) |
---|
[102] | 131 | $(cmtexe) -quiet build dependencies cmt -all_sources -no_stamps |
---|
[2] | 132 | cp $(bin)/cmt_dependencies.make ../mgr |
---|
[102] | 133 | $(cmtexe) -quiet build dependencies cmt -all_sources |
---|
[2] | 134 | |
---|
| 135 | #--------------------------------------------------------- |
---|
| 136 | |
---|
| 137 | #--------------------------------------------------------- |
---|
| 138 | # This procedure installs a hook into the commitinfo management file. |
---|
| 139 | # then the |
---|
| 140 | #--------------------------------------------------------- |
---|
| 141 | installcvs : |
---|
| 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 | #--------------------------------------------------------- |
---|
| 166 | doxygen :: |
---|
| 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 | #--------------------------------------------------------- |
---|
| 173 | pdf :: |
---|
| 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 | |
---|
[46] | 179 | #python = python |
---|
| 180 | python = /afs/cern.ch/sw/lcg/external/Python/2.3.4/rh73_gcc323/bin/python |
---|
| 181 | #python = /cygdrive/c/Arnault/Python23/python.exe |
---|
[2] | 182 | |
---|
| 183 | #--------------------------------------------------------- |
---|
| 184 | # Generates the html form of the doc from the XML form |
---|
| 185 | #--------------------------------------------------------- |
---|
| 186 | gendoc :: |
---|
[115] | 187 | @cd ../doc; python gendoc.py CMTDoc.xml > CMTDoc.html |
---|
[2] | 188 | @echo "CMTDoc.html generated from CMTDoc.xml" |
---|
| 189 | |
---|
| 190 | |
---|
| 191 | #--------------------------------------------------------- |
---|
| 192 | # Transfer the docs into the Web site. |
---|
| 193 | #--------------------------------------------------------- |
---|
| 194 | docs :: |
---|
| 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 | |
---|
[45] | 207 | #--------------------------------------------------------- |
---|
| 208 | # Construct the pacman file from the generic form |
---|
| 209 | #--------------------------------------------------------- |
---|
| 210 | pacman :: |
---|
| 211 | version=`cmt version`; \ |
---|
| 212 | sed -e 's#<version>#'"$${version}"'#g' CMT.pacman >CMT-$${version}.pacman |
---|
[2] | 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 | #--------------------------------------------------------- |
---|
[103] | 220 | bintar :: |
---|
[2] | 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; \ |
---|
[103] | 232 | ${CMTROOT}/mgr/cmt_export.sh CMT/ $${root}/doc/CMTDownload.html $${tag}; \ |
---|
[2] | 233 | if test -d rpm; then \ |
---|
[103] | 234 | ${CMTROOT}/mgr/cmt_export.sh CMT/ $${root}/rpm/CMT-$${version}-1.i386.rpm $${tag}; \ |
---|
[2] | 235 | fi; \ |
---|
| 236 | cd ../../; \ |
---|
| 237 | for branch in `echo $${binaries}` ; \ |
---|
| 238 | do \ |
---|
[103] | 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 ; \ |
---|
[2] | 245 | echo $${branch} ; \ |
---|
[103] | 246 | tarfile=CMT/CMT$${version}$${branch}.tar; \ |
---|
| 247 | tar cf $${tarfile} CMT/$${version}/mgr CMT/$${version}/src CMT/$${version}/$${branch} ; \ |
---|
[2] | 248 | gzip $${tarfile}; \ |
---|
[103] | 249 | ${CMTROOT}/mgr/cmt_export.sh CMT/ $${tarfile}.gz $${tag} ; \ |
---|
[2] | 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 | #---------------------------------------------------------- |
---|
| 262 | rpm :: |
---|
[102] | 263 | version=`$(cmtexe) -quiet version`; \ |
---|
[2] | 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; \ |
---|
[92] | 269 | (cd ../; tar cf $${tempdir}/SOURCES/CMT$${version}.tar --exclude mgr src source); \ |
---|
[2] | 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 | #---------------------------------------------------------- |
---|
| 287 | srctar :: |
---|
[92] | 288 | ${CMTROOT}/mgr/cmt_tar_export.sh source mgr src Visual java doc |
---|
[2] | 289 | |
---|
| 290 | |
---|
| 291 | #---------------------------------------------------------- |
---|
| 292 | # Construct the kits |
---|
| 293 | #---------------------------------------------------------- |
---|
[103] | 294 | Export :: docs srctar bintar |
---|
[2] | 295 | @echo Export done |
---|
| 296 | |
---|
| 297 | democlean :: |
---|
| 298 | /bin/rm -rf ../demo/* |
---|
| 299 | |
---|
| 300 | demo_location = ../demo |
---|
| 301 | demo_sequence = demo1 |
---|
| 302 | |
---|
| 303 | #---------------------------------------------------------- |
---|
| 304 | # Run the autotest sequence |
---|
| 305 | #---------------------------------------------------------- |
---|
| 306 | demo :: 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); \ |
---|
[102] | 313 | version=`$(cmtexe) -quiet version`; \ |
---|
| 314 | ($(cmtexe) -quiet run_sequence ${CMTROOT}/src/demo/$(demo_sequence).cmt | \ |
---|
[2] | 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 | |
---|
| 332 | tprivate :: 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}; \ |
---|
[102] | 340 | version=`$(cmtexe) -quiet version`; \ |
---|
[2] | 341 | echo " Creating all $${sequence} packages..."; \ |
---|
[102] | 342 | ($(cmtexe) -quiet run_sequence ${CMTROOT}/src/demo/$${sequence}.cmt | \ |
---|
[2] | 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 | |
---|
| 360 | help :: |
---|
| 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 | |
---|