#!/usr/bin/env perl # release must be passed as an argument $release = $ARGV[0]; if($#ARGV<0){&Usage();} $halld_home = $ENV{"PWD"}."/$release"; $ENV{"HALLD_HOME"} = $halld_home; print "\nMaking release \"$release\" ($halld_home)\n\n"; # Check if we are checking out an existing tag or just grabbing the latest if($release eq "latest"){ print "\"latest\" specified, no tag will be used for checkout.\n"; }else{ $tags = "-r $release"; } # Move old "$release" out of the way (if it exists) and make new one if(-e $release){ print `mkdir -p junk`; print `rm -rf junk/$release`; print `mv -f $release junk`; } mkdir $release; chdir $release; # Checkout release to new directory #system("cvs -d cvs.jlab.org:/group/halld/Repositories/cvsroot co $tags release"); system("svn co https://halldsvn.jlab.org/repos/$svndir/src"); system("svn co https://halldsvn.jlab.org/repos/$svndir/scripts"); system("svn co https://halldsvn.jlab.org/repos/$svndir/xstream"); # Regenerate hddm files from schema print "\nBuilding HDDM tools ...\n\n"; chdir $halld_home; $cmd = "mkdir -p lib/".$ENV{"OSNAME"}; print "$cmd\n".`$cmd`; system("make -C xstream/src install"); chdir "src/programs/Analysis/hddm"; system("make install"); print "\n...generating hddm C/C++ source ...\n"; system("rm -f event.xml"); system("schema-hddm event.xsd > event.xml"); system("hddm-c event.xml"); #system("cp hddm_s.h ../../../libraries/include"); # Build libraries print "\nBuilding Libraries ...\n\n"; chdir "$halld_home/src/libraries"; system("make"); # Build executables print "\nBuilding executables ...\n\n"; chdir "$halld_home/src/programs/Analysis/hd_ana"; system("make"); chdir "$halld_home/src/programs/Analysis/hd_dump"; system("make"); chdir "$halld_home/src/programs/Analysis/hdview"; system("make"); chdir "$halld_home/src/programs/Analysis/bfield2root"; system("make"); chdir "$halld_home/src/programs/Analysis/mctrk_ana"; system("make"); chdir "$halld_home/src/programs/Simulation/genr8"; system("make install"); chdir "$halld_home/src/programs/Simulation/genr8_2_hddm"; system("make"); chdir "$halld_home/src/programs/Simulation/hdds"; system("make"); # HDGeant chdir "$halld_home/src/programs/Simulation/HDGeant/gelhad"; system("make"); chdir "$halld_home/src/programs/Simulation/HDGeant"; system("make"); # Rebuild documentation #chdir "$halld_home/src/doc"; #system("make clean ; make"); # Print usage statement and exit sub Usage() { print "\nUsage:\n\t\tmake_local_release \n\n"; print "Note that giving the release name \"latest\" will cause\n"; print "The most current version of the code to be checked out\n"; print "(without any tag).\n\n"; print "This is a limited version of the \"make_release\" script.\n"; print "The main differences are that this won't rebuild all of \n"; print "the doxygen generated documentation.\n"; print "(You can do that by hand by just running make in the src/doc\n"; print "directory.)\n\n"; print "The intent of this script is to be more useful to someone who\n"; print "wants to check out and build the source code on an offsite\n"; print "machine.\n\n"; exit(0); }