#!/usr/bin/python import os, sys, string # Specify the demos you want to build below in case you don't have all necessary # build tools installed ALL_DEMOS="adv cc cxx d gnome java ocaml perl python qt4 tex vala unit_test" if len(sys.argv) != 2: print 'Usage %s <demodir> | [--all]' % sys.argv[0] sys.exit() waf_command = '../../waf-light' if '--all' in sys.argv: demos = ALL_DEMOS else: demos = sys.argv[1] report = []; for demo in demos.split(): print '' print '================================================================================' print 'Building demo: %s' % demo print '================================================================================' cwd = os.getcwd() os.chdir('%s/%s' % (cwd, demo)) distclean = 'OK' ret = os.system('%s distclean' % waf_command) if ret != 0: distclean = "ERROR" configure = 'OK' ret = os.system('%s configure' % waf_command) if ret != 0: configure = 'ERROR' build = 'OK' ret = os.system('%s build' % waf_command) if ret != 0: build = 'ERROR' os.chdir(cwd) result = '%s: distclean: %s configure: %s build: %s' % (demo, distclean, configure, build) report.append(result) print '\nOverall report' for i in report: print i