SCons: centralize the Dir() workaround for newer versions of scons.
[gem5.git] / src / arch / sparc / SConscript
index 7362c92759bf6258f67a1d1a12e30f96e15415ba..6a4c08a8efd03178f442a73dac3eb93d00a7f1a6 100644 (file)
 # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
 # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-import os
-import sys
-from os.path import isdir
-
-# Import build environment variable from SConstruct.
-Import('env')
-
-###################################################
-#
-# Define needed sources.
 #
-###################################################
+# Authors: Gabe Black
+#          Steve Reinhardt
 
-# Base sources used by all configurations.
-base_sources = Split('''
-       faults.cc
-       isa_traits.cc
-       ''')
+Import('*')
 
-# Full-system sources
-full_system_sources = Split('''
-       tlb.cc
-       arguments.cc
-       ev5.cc
-       osfpal.cc
-       stacktrace.cc
-       vtophys.cc
-       ''')
+if env['TARGET_ISA'] == 'sparc':
+    Source('asi.cc')
+    Source('faults.cc')
+    Source('floatregfile.cc')
+    Source('intregfile.cc')
+    Source('miscregfile.cc')
+    Source('pagetable.cc')
+    Source('regfile.cc')
+    Source('remote_gdb.cc')
+    Source('tlb.cc')
+    Source('utility.cc')
 
-# Syscall emulation (non-full-system) sources
-syscall_emulation_sources = Split('''
-       linux/linux.cc
-       linux/process.cc
-       solaris/solaris.cc
-       solaris/process.cc
-       process.cc
-       ''')
+    SimObject('SparcTLB.py')
+    TraceFlag('Sparc')
 
-sources = base_sources
+    if env['FULL_SYSTEM']:
+        SimObject('SparcSystem.py')
+        SimObject('SparcInterrupts.py')
 
-if env['FULL_SYSTEM']:
-    sources += full_system_sources
-else:
-    sources += syscall_emulation_sources
+        Source('interrupts.cc')
+        Source('stacktrace.cc')
+        Source('system.cc')
+        Source('ua2005.cc')
+        Source('vtophys.cc')
+    else:
+        Source('process.cc')
 
-# Convert file names to SCons File objects.  This takes care of the
-# path relative to the top of the directory tree.
-sources = [File(s) for s in sources]
+        Source('linux/linux.cc')
+        Source('linux/process.cc')
+        Source('linux/syscalls.cc')
 
-# Add in files generated by the ISA description.
-isa_desc_files = env.ISADesc('isa/main.isa')
-# Only non-header files need to be compiled.
-isa_desc_sources = [f for f in isa_desc_files if not f.path.endswith('.hh')]
-sources += isa_desc_sources
+        Source('solaris/process.cc')
+        Source('solaris/solaris.cc')
 
-Return('sources')
+    # Add in files generated by the ISA description.
+    isa_desc_files = env.ISADesc('isa/main.isa')
+    # Only non-header files need to be compiled.
+    for f in isa_desc_files:
+        if not f.path.endswith('.hh'):
+            Source(f)