scons: Get rid of the PHONY_BASE construction variable.
authorGabe Black <gabeblack@google.com>
Tue, 2 May 2017 02:50:30 +0000 (19:50 -0700)
committerGabe Black <gabeblack@google.com>
Mon, 8 May 2017 22:11:13 +0000 (22:11 +0000)
The value of that variable can be computed more directly and more locally
to where it's consumed.

Change-Id: I5ca1f732a34e22d4dae2aeb6ee7fc8adebe1caa0
Reviewed-on: https://gem5-review.googlesource.com/2981
Maintainer: Jason Lowe-Power <jason@lowepower.com>
Reviewed-by: Curtis Dunham <curtis.dunham@arm.com>
Reviewed-by: Jason Lowe-Power <jason@lowepower.com>
SConstruct
src/SConscript

index d252865dbaccd24b5a6196edce330fec4c8c04ab..f56c23df7a42232d63a5b54dcee23d555e6fbd37 100755 (executable)
@@ -1357,7 +1357,6 @@ def make_switching_dir(dname, switch_headers, env):
         env.Command(hdr, [], switch_hdr_action)
 
     isa_target = Dir('.').up().name.lower().replace('_', '-')
-    env['PHONY_BASE'] = '#'+isa_target
     all_isa_deps[isa_target] = None
 
 Export('make_switching_dir')
@@ -1421,6 +1420,11 @@ BUILD_TARGETS[:] = ['#all-targets']
 #
 ###################################################
 
+def variant_name(path):
+    return os.path.basename(path).lower().replace('_', '-')
+main['variant_name'] = variant_name
+main['VARIANT_NAME'] = '${variant_name(BUILDDIR)}'
+
 for variant_path in variant_paths:
     if not GetOption('silent'):
         print "Building in", variant_path
index 155dcf53d886d05882693323acc636c3dba1836a..ed59bd22820486df3efbb4bb5455ffaebd438663 100755 (executable)
@@ -1233,9 +1233,9 @@ env.Append(BUILDERS = {'MakeEnvirons' :
                         Builder(action=MakeAction(makeEnvirons,
                                                   Transform("ENVIRONS", 1)))})
 
-isa_target = env['PHONY_BASE'] + '-deps'
-environs   = env['PHONY_BASE'] + '-environs'
-env.Depends('#all-deps',     isa_target)
+isa_target = '#${VARIANT_NAME}-deps'
+environs = '#${VARIANT_NAME}-environs'
+env.Depends('#all-deps', isa_target)
 env.Depends('#all-environs', environs)
 env.ScanISA(isa_target, File('arch/%s/generated/inc.d' % env['TARGET_ISA']))
 envSetup = env.MakeEnvirons(environs, isa_target)