From f7a09b59853bae31861e572f5d5cde42f762c233 Mon Sep 17 00:00:00 2001 From: Chris Johns Date: Mon, 26 Mar 2018 15:14:52 +1100 Subject: waf: Support building from libbsd.py directly from waf. Remove the need to generate a waf script. Move various pieces of data from the builder code to libbsd.py and make it configuration data. Update #3351 --- freebsd-to-rtems.py | 18 +++--------------- 1 file changed, 3 insertions(+), 15 deletions(-) (limited to 'freebsd-to-rtems.py') diff --git a/freebsd-to-rtems.py b/freebsd-to-rtems.py index 443fa833..e5cdac50 100755 --- a/freebsd-to-rtems.py +++ b/freebsd-to-rtems.py @@ -42,12 +42,10 @@ import sys import getopt import builder -import waf_generator import libbsd isForward = True isEarlyExit = False -isOnlyBuildScripts = False statsReport = False def usage(): @@ -57,7 +55,6 @@ def usage(): print(" -D|--diff provide diff of files between trees") print(" -e|--early-exit evaluate arguments, print results, and exit") print(" -m|--makefile Warning: depreciated and will be removed ") - print(" -b|--buildscripts just generate the build scripts") print(" -S|--stats Print a statistics report") print(" -R|--reverse default origin -> LibBSD, reverse that") print(" -r|--rtems LibBSD directory (default: '.')") @@ -67,7 +64,6 @@ def usage(): # Parse the arguments def parseArguments(): global isForward, isEarlyExit, statsReport - global isOnlyBuildScripts try: opts, args = getopt.getopt(sys.argv[1:], "?hdDembSRr:f:v", @@ -100,8 +96,6 @@ def parseArguments(): builder.isDiffMode = True elif o in ("-e", "--early-exit"): isEarlyExit = True - elif o in ("-b", "--buildscripts") or o in ("-m", "--makefile"): - isOnlyBuildScripts = True elif o in ("-S", "--stats"): statsReport = True elif o in ("-R", "--reverse"): @@ -119,7 +113,6 @@ print("Verbose: %s (%d)" % (("no", "yes")[builder.verbose()] builder.verboseLevel)) print("Dry Run: %s" % (("no", "yes")[builder.isDryRun])) print("Diff Mode Enabled: %s" % (("no", "yes")[builder.isDiffMode])) -print("Only Generate Build Scripts: %s" % (("no", "yes")[isOnlyBuildScripts])) print("LibBSD Directory: %s" % (builder.LIBBSD_DIR)) print("FreeBSD Directory: %s" % (builder.FreeBSD_DIR)) print("Direction: %s" % (("reverse", "forward")[isForward])) @@ -143,20 +136,15 @@ if isForward == True: print("Forward from", builder.FreeBSD_DIR, "into", builder.LIBBSD_DIR) else: print("Reverting from", builder.LIBBSD_DIR) - if isOnlyBuildScripts == True: - print("error: Build Script generation and Reverse are contradictory") - sys.exit(2) if isEarlyExit == True: print("Early exit at user request") sys.exit(0) try: - wafGen = waf_generator.ModuleManager() - libbsd.sources(wafGen) - if not isOnlyBuildScripts: - wafGen.processSource(isForward) - wafGen.generate(libbsd.rtems_version()) + build = builder.ModuleManager() + libbsd.loadModules(build) + build.processSource(isForward) builder.changedFileSummary(statsReport) except IOError as ioe: print('error: %s' % (str(ioe))) -- cgit v1.2.3