SConscript (5623:11a1079070b6) SConscript (5742:828a8296270e)
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

--- 22 unchanged lines hidden (view full) ---

31import array
32import imp
33import marshal
34import os
35import re
36import sys
37import zlib
38
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

--- 22 unchanged lines hidden (view full) ---

31import array
32import imp
33import marshal
34import os
35import re
36import sys
37import zlib
38
39from os.path import basename, exists, isdir, isfile, join as joinpath
39from os.path import basename, dirname, exists, isdir, isfile, join as joinpath
40
41import SCons
42
43# This file defines how to build a particular configuration of M5
44# based on variable settings in the 'env' build environment.
45
46Import('*')
47

--- 161 unchanged lines hidden (view full) ---

209#
210
211# Include file paths are rooted in this directory. SCons will
212# automatically expand '.' to refer to both the source directory and
213# the corresponding build directory to pick up generated include
214# files.
215env.Append(CPPPATH=Dir('.'))
216
40
41import SCons
42
43# This file defines how to build a particular configuration of M5
44# based on variable settings in the 'env' build environment.
45
46Import('*')
47

--- 161 unchanged lines hidden (view full) ---

209#
210
211# Include file paths are rooted in this directory. SCons will
212# automatically expand '.' to refer to both the source directory and
213# the corresponding build directory to pick up generated include
214# files.
215env.Append(CPPPATH=Dir('.'))
216
217for extra_dir in extras_dir_list:
218 env.Append(CPPPATH=Dir(extra_dir))
219
217# Add a flag defining what THE_ISA should be for all compilation
218env.Append(CPPDEFINES=[('THE_ISA','%s_ISA' % env['TARGET_ISA'].upper())])
219
220########################################################################
221#
222# Walk the tree and execute all SConscripts in subdirectories
223#
224
220# Add a flag defining what THE_ISA should be for all compilation
221env.Append(CPPDEFINES=[('THE_ISA','%s_ISA' % env['TARGET_ISA'].upper())])
222
223########################################################################
224#
225# Walk the tree and execute all SConscripts in subdirectories
226#
227
225for base_dir in base_dir_list:
226 here = Dir('.').srcnode().abspath
227 for root, dirs, files in os.walk(base_dir, topdown=True):
228 if root == here:
229 # we don't want to recurse back into this SConscript
230 continue
228here = Dir('.').srcnode().abspath
229for root, dirs, files in os.walk(base_dir, topdown=True):
230 if root == here:
231 # we don't want to recurse back into this SConscript
232 continue
231
233
234 if 'SConscript' in files:
235 build_dir = joinpath(env['BUILDDIR'], root[len(base_dir) + 1:])
236 SConscript(joinpath(root, 'SConscript'), build_dir=build_dir)
237
238for extra_dir in extras_dir_list:
239 prefix_len = len(dirname(extra_dir)) + 1
240 for root, dirs, files in os.walk(extra_dir, topdown=True):
232 if 'SConscript' in files:
241 if 'SConscript' in files:
233 build_dir = joinpath(env['BUILDDIR'], root[len(base_dir) + 1:])
242 build_dir = joinpath(env['BUILDDIR'], root[prefix_len:])
234 SConscript(joinpath(root, 'SConscript'), build_dir=build_dir)
235
236for opt in env.ExportOptions:
237 env.ConfigFile(opt)
238
239########################################################################
240#
241# Prevent any SimObjects from being added after this point, they

--- 826 unchanged lines hidden ---
243 SConscript(joinpath(root, 'SConscript'), build_dir=build_dir)
244
245for opt in env.ExportOptions:
246 env.ConfigFile(opt)
247
248########################################################################
249#
250# Prevent any SimObjects from being added after this point, they

--- 826 unchanged lines hidden ---