diff --git a/SConstruct b/SConstruct --- a/SConstruct +++ b/SConstruct @@ -180,6 +180,8 @@ use_env[key] = val main = Environment(ENV=use_env) +main.Decider('MD5-timestamp') +main.SetOption('implicit_cache', 1) main.root = Dir(".") # The current directory (where this file lives). main.srcdir = Dir("src") # The source directory diff --git a/src/SConscript b/src/SConscript --- a/src/SConscript +++ b/src/SConscript @@ -953,24 +953,32 @@ print 'Unknown compiler, please fix compiler options' Exit(1) -makeEnv('debug', '.do', - CCFLAGS = Split(ccflags['debug']), - CPPDEFINES = ['DEBUG', 'TRACING_ON=1']) +targetTypes = [target.split('.')[-1] for target in BUILD_TARGETS] +targetTypes += [target.split('/')[-3] for target in BUILD_TARGETS] +# Debug binary +if 'debug' in targetTypes: + makeEnv('debug', '.do', + CCFLAGS = Split(ccflags['debug']), + CPPDEFINES = ['DEBUG', 'TRACING_ON=1']) # Optimized binary -makeEnv('opt', '.o', - CCFLAGS = Split(ccflags['opt']), - CPPDEFINES = ['TRACING_ON=1']) +if 'opt' in targetTypes: + makeEnv('opt', '.o', + CCFLAGS = Split(ccflags['opt']), + CPPDEFINES = ['TRACING_ON=1']) # "Fast" binary -makeEnv('fast', '.fo', strip = True, - CCFLAGS = Split(ccflags['fast']), - CPPDEFINES = ['NDEBUG', 'TRACING_ON=0']) +if 'fast' in targetTypes: + makeEnv('fast', '.fo', strip = True, + CCFLAGS = Split(ccflags['fast']), + CPPDEFINES = ['NDEBUG', 'TRACING_ON=0']) # Profiled binary -makeEnv('prof', '.po', - CCFLAGS = Split(ccflags['prof']), - CPPDEFINES = ['NDEBUG', 'TRACING_ON=0'], - LINKFLAGS = '-pg') +if 'prof' in targetTypes: + makeEnv('prof', '.po', + CCFLAGS = Split(ccflags['prof']), + CPPDEFINES = ['NDEBUG', 'TRACING_ON=0'], + LINKFLAGS = '-pg') + Return('envList') diff --git a/src/mem/protocol/SConscript b/src/mem/protocol/SConscript --- a/src/mem/protocol/SConscript +++ b/src/mem/protocol/SConscript @@ -69,7 +69,7 @@ slicc = SLICC(filepath, verbose=False) slicc.process() slicc.writeCodeFiles(protocol_dir.abspath) - if not env['NO_HTML']: + if env['SLICC_HTML']: slicc.writeHTMLFiles(html_dir.abspath) target.extend([protocol_dir.File(f) for f in sorted(slicc.files())]) @@ -82,7 +82,7 @@ slicc = SLICC(filepath, verbose=True) slicc.process() slicc.writeCodeFiles(protocol_dir.abspath) - if not env['NO_HTML']: + if env['SLICC_HTML']: slicc.writeHTMLFiles(html_dir.abspath) slicc_builder = Builder(action=MakeAction(slicc_action, Transform("SLICC")), diff --git a/src/mem/protocol/SConsopts b/src/mem/protocol/SConsopts --- a/src/mem/protocol/SConsopts +++ b/src/mem/protocol/SConsopts @@ -48,5 +48,5 @@ sticky_vars.AddVariables(opt) export_vars += ['PROTOCOL'] -opt = BoolVariable('NO_HTML', 'Do not create HTML files', False) +opt = BoolVariable('SLICC_HTML', 'Create HTML files', False) sticky_vars.AddVariables(opt)