# main SConstruct for building Hall D online packages # # This will simply run scons in each of the directories # listed in the "packages" variable, passing it a list of the # arguments given on the command line. It is done this # way because each package contains it's own SConstruct file # so that it can be built independently. Reading them in with # the SConscript routine did not seem to work so this solution # has been implemented. import subprocess packages = ['RootSpy', 'etUtils', 'miscUtils', 'raidUtils', 'monitoring', 'HDdataflow'] # Get all key=value arguments args = [] for key,value in ARGLIST : args.append('%s=%s' % (key, value)) # Add in select standard scons args (-jN -c, ..) args.append('-j%d' % GetOption('num_jobs')) if GetOption('clean') : args.append('-c') # Add all targets specified on the command line args.extend(COMMAND_LINE_TARGETS) # Tell this scons invocation to basically ignore all targets for clt in COMMAND_LINE_TARGETS: Alias(clt, '.') # Loop over all packages and invoke scons in each of them in # the background so they can run in parallel procs = [] for package in packages: cmd = ['scons', '-C', package] + args procs.append(subprocess.Popen(cmd)) # Loop over all procs and wait for them all to finish # We do this so the final messages and shell prompt will be # printed only after everything is finished. Otherwise, it # makes it look like it is still working on stuff. for proc in procs: proc.wait()