SConscript (11988:665cd5f8b52b) | SConscript (11993:a10174523d53) |
---|---|
1# -*- mode:python -*- 2 3# Copyright (c) 2004-2005 The Regents of The University of Michigan 4# All rights reserved. 5# 6# Redistribution and use in source and binary forms, with or without 7# modification, are permitted provided that the following conditions are 8# met: redistributions of source code must retain the above copyright --- 1099 unchanged lines hidden (view full) --- 1108 cmd = 'strip $SOURCE -o $TARGET' 1109 targets = new_env.Command(exename, progname, 1110 MakeAction(cmd, Transform("STRIP"))) 1111 1112 new_env.Command(secondary_exename, exename, 1113 MakeAction('ln $SOURCE $TARGET', Transform("HARDLINK"))) 1114 1115 new_env.M5Binary = targets[0] | 1# -*- mode:python -*- 2 3# Copyright (c) 2004-2005 The Regents of The University of Michigan 4# All rights reserved. 5# 6# Redistribution and use in source and binary forms, with or without 7# modification, are permitted provided that the following conditions are 8# met: redistributions of source code must retain the above copyright --- 1099 unchanged lines hidden (view full) --- 1108 cmd = 'strip $SOURCE -o $TARGET' 1109 targets = new_env.Command(exename, progname, 1110 MakeAction(cmd, Transform("STRIP"))) 1111 1112 new_env.Command(secondary_exename, exename, 1113 MakeAction('ln $SOURCE $TARGET', Transform("HARDLINK"))) 1114 1115 new_env.M5Binary = targets[0] |
1116 return new_env | |
1117 | 1116 |
1117 # Set up regression tests. 1118 SConscript(os.path.join(env.root.abspath, 'tests', 'SConscript'), 1119 variant_dir=variantd('tests', new_env.Label), 1120 exports={ 'env' : new_env }, duplicate=False) 1121 |
|
1118# Start out with the compiler flags common to all compilers, 1119# i.e. they all use -g for opt and -g -pg for prof 1120ccflags = {'debug' : [], 'opt' : ['-g'], 'fast' : [], 'prof' : ['-g', '-pg'], 1121 'perf' : ['-g']} 1122 1123# Start out with the linker flags common to all linkers, i.e. -pg for 1124# prof, and -lprofiler for perf. The -lprofile flag is surrounded by 1125# no-as-needed and as-needed as the binutils linker is too clever and --- 52 unchanged lines hidden (view full) --- 1178needed_envs = [identifyTarget(target) for target in BUILD_TARGETS] 1179if 'all' in needed_envs: 1180 needed_envs += target_types 1181 1182def makeEnvirons(target, source, env): 1183 # cause any later Source() calls to be fatal, as a diagnostic. 1184 Source.done() 1185 | 1122# Start out with the compiler flags common to all compilers, 1123# i.e. they all use -g for opt and -g -pg for prof 1124ccflags = {'debug' : [], 'opt' : ['-g'], 'fast' : [], 'prof' : ['-g', '-pg'], 1125 'perf' : ['-g']} 1126 1127# Start out with the linker flags common to all linkers, i.e. -pg for 1128# prof, and -lprofiler for perf. The -lprofile flag is surrounded by 1129# no-as-needed and as-needed as the binutils linker is too clever and --- 52 unchanged lines hidden (view full) --- 1182needed_envs = [identifyTarget(target) for target in BUILD_TARGETS] 1183if 'all' in needed_envs: 1184 needed_envs += target_types 1185 1186def makeEnvirons(target, source, env): 1187 # cause any later Source() calls to be fatal, as a diagnostic. 1188 Source.done() 1189 |
1186 envList = [] 1187 | |
1188 # Debug binary 1189 if 'debug' in needed_envs: | 1190 # Debug binary 1191 if 'debug' in needed_envs: |
1190 envList.append( 1191 makeEnv(env, 'debug', '.do', 1192 CCFLAGS = Split(ccflags['debug']), 1193 CPPDEFINES = ['DEBUG', 'TRACING_ON=1'], 1194 LINKFLAGS = Split(ldflags['debug']))) | 1192 makeEnv(env, 'debug', '.do', 1193 CCFLAGS = Split(ccflags['debug']), 1194 CPPDEFINES = ['DEBUG', 'TRACING_ON=1'], 1195 LINKFLAGS = Split(ldflags['debug'])) |
1195 1196 # Optimized binary 1197 if 'opt' in needed_envs: | 1196 1197 # Optimized binary 1198 if 'opt' in needed_envs: |
1198 envList.append( 1199 makeEnv(env, 'opt', '.o', 1200 CCFLAGS = Split(ccflags['opt']), 1201 CPPDEFINES = ['TRACING_ON=1'], 1202 LINKFLAGS = Split(ldflags['opt']))) | 1199 makeEnv(env, 'opt', '.o', 1200 CCFLAGS = Split(ccflags['opt']), 1201 CPPDEFINES = ['TRACING_ON=1'], 1202 LINKFLAGS = Split(ldflags['opt'])) |
1203 1204 # "Fast" binary 1205 if 'fast' in needed_envs: | 1203 1204 # "Fast" binary 1205 if 'fast' in needed_envs: |
1206 envList.append( 1207 makeEnv(env, 'fast', '.fo', strip = True, 1208 CCFLAGS = Split(ccflags['fast']), 1209 CPPDEFINES = ['NDEBUG', 'TRACING_ON=0'], 1210 LINKFLAGS = Split(ldflags['fast']))) | 1206 makeEnv(env, 'fast', '.fo', strip = True, 1207 CCFLAGS = Split(ccflags['fast']), 1208 CPPDEFINES = ['NDEBUG', 'TRACING_ON=0'], 1209 LINKFLAGS = Split(ldflags['fast'])) |
1211 1212 # Profiled binary using gprof 1213 if 'prof' in needed_envs: | 1210 1211 # Profiled binary using gprof 1212 if 'prof' in needed_envs: |
1214 envList.append( 1215 makeEnv(env, 'prof', '.po', 1216 CCFLAGS = Split(ccflags['prof']), 1217 CPPDEFINES = ['NDEBUG', 'TRACING_ON=0'], 1218 LINKFLAGS = Split(ldflags['prof']))) | 1213 makeEnv(env, 'prof', '.po', 1214 CCFLAGS = Split(ccflags['prof']), 1215 CPPDEFINES = ['NDEBUG', 'TRACING_ON=0'], 1216 LINKFLAGS = Split(ldflags['prof'])) |
1219 1220 # Profiled binary using google-pprof 1221 if 'perf' in needed_envs: | 1217 1218 # Profiled binary using google-pprof 1219 if 'perf' in needed_envs: |
1222 envList.append( 1223 makeEnv(env, 'perf', '.gpo', 1224 CCFLAGS = Split(ccflags['perf']), 1225 CPPDEFINES = ['NDEBUG', 'TRACING_ON=0'], 1226 LINKFLAGS = Split(ldflags['perf']))) | 1220 makeEnv(env, 'perf', '.gpo', 1221 CCFLAGS = Split(ccflags['perf']), 1222 CPPDEFINES = ['NDEBUG', 'TRACING_ON=0'], 1223 LINKFLAGS = Split(ldflags['perf'])) |
1227 | 1224 |
1228 # Set up the regression tests for each build. 1229 for e in envList: 1230 SConscript(os.path.join(env.root.abspath, 'tests', 'SConscript'), 1231 variant_dir = variantd('tests', e.Label), 1232 exports = { 'env' : e }, duplicate = False) 1233 | |
1234# The MakeEnvirons Builder defers the full dependency collection until 1235# after processing the ISA definition (due to dynamically generated 1236# source files). Add this dependency to all targets so they will wait 1237# until the environments are completely set up. Otherwise, a second 1238# process (e.g. -j2 or higher) will try to compile the requested target, 1239# not know how, and fail. 1240env.Append(BUILDERS = {'MakeEnvirons' : 1241 Builder(action=MakeAction(makeEnvirons, --- 13 unchanged lines hidden --- | 1225# The MakeEnvirons Builder defers the full dependency collection until 1226# after processing the ISA definition (due to dynamically generated 1227# source files). Add this dependency to all targets so they will wait 1228# until the environments are completely set up. Otherwise, a second 1229# process (e.g. -j2 or higher) will try to compile the requested target, 1230# not know how, and fail. 1231env.Append(BUILDERS = {'MakeEnvirons' : 1232 Builder(action=MakeAction(makeEnvirons, --- 13 unchanged lines hidden --- |