]> git.mdlowis.com Git - proto/sclpl.git/commitdiff
Updated environments in build script. mingw no longer used on non-windows platforms
authorMichael D. Lowis <mike@mdlowis.com>
Mon, 5 May 2014 20:42:06 +0000 (16:42 -0400)
committerMichael D. Lowis <mike@mdlowis.com>
Mon, 5 May 2014 20:42:06 +0000 (16:42 -0400)
SConstruct

index 5399933c4100e565b6a9dc00f67f146a2c661617..7db068d0956f36879cf33285f2329bfec48695f1 100644 (file)
@@ -35,13 +35,20 @@ def RunTest( output, runner ):
 # Compiler Environments
 #------------------------------------------------------------------------------
 
+# Base Environment
+#-----------------
+base = Environment(
+    ENV     = os.environ,
+    CCFLAGS = [],
+    LDFLAGS = [])
+
+# On windows use mingw because VS is not C99 compliant
+if platform.system() == 'Windows':
+    base.Append(TOOLS=['mingw'])
+
 # Default C/C++ Environment
 #---------------------------
-c_cpp = Environment(
-        ENV      = os.environ,
-        CCFLAGS  = [ '-Wall', '-Werror', '-std=c99' ],
-        LDFLAGS  = [],
-        TOOLS    = [ 'mingw' ])
+c_cpp = base.Clone(CCFLAGS = [ '-Wall', '-Werror', '-std=c99' ])
 
 # Chicken Scheme Environment
 #---------------------------
@@ -60,46 +67,40 @@ scheme_linker = Builder(
         src_builder = [ scheme_compiler ])
 
 # Create the Environment for this project
-scheme = Environment(
-        ENV      = os.environ,
-        CCFLAGS  = [ '-I', 'inc'],
-        LDFLAGS  = [],
-        TOOLS    = [ 'mingw' ],
-        BUILDERS = { 'Program': scheme_linker })
-scheme.PrependENVPath('PATH', './build')
+scheme = base.Clone(CCFLAGS  = [ '-I', 'inc'],
+                    BUILDERS = { 'Program': scheme_linker })
 
 #------------------------------------------------------------------------------
 # SCLPL Targets
 #------------------------------------------------------------------------------
 
 # SOF Shared Library
-#c_cpp.SharedLibrary('build/sof', find_files('source/libsof/','*.c'))
+c_cpp.SharedLibrary('build/sof', find_files('source/libsof/','*.c'))
 
 # SBC Shared Library
-#c_cpp.SharedLibrary('build/sbc', find_files('source/libsbc/','*.c'))
+c_cpp.SharedLibrary('build/sbc', find_files('source/libsbc/','*.c'))
 
 # readsof Command Line Utility
-#readsof = c_cpp.Clone(
-#        CPPPATH = [ 'source/libsof/' ],
-#        LIBS = [ 'sof' ],
-#        LIBPATH = [ 'build' ])
-#readsof.Program('build/readsof', find_files('source/readsof/','*.c'))
-#readsof.Depends('readsof', 'sof')
-
-## SCLPL Compiler
-#SchemeBuildAndTest( 'build/slc',
-#                    find_files('source/slc/','*.scm'),
-#                    find_files('tests/slc/','*.scm') )
-#
-## SCLPL Package Manager
-#SchemeBuildAndTest( 'build/slpkg',
-#                    find_files('source/slpkg/','*.scm'),
-#                    find_files('tests/slpkg/','*.scm') )
-#
-## SCLPL Assembler
-#SchemeBuildAndTest( 'build/slas',
-#                    find_files('source/slas/','*.scm'),
-#                    find_files('tests/slas/','*.scm') )
+readsof = c_cpp.Clone(CPPPATH = [ 'source/libsof/' ],
+                      LIBS    = [ 'sof' ],
+                      LIBPATH = [ 'build' ])
+readsof.Program('build/readsof', find_files('source/readsof/','*.c'))
+readsof.Depends('readsof', 'sof')
+
+# SCLPL Compiler
+SchemeBuildAndTest( 'build/slc',
+                    find_files('source/slc/','*.scm'),
+                    find_files('tests/slc/','*.scm') )
+
+# SCLPL Package Manager
+SchemeBuildAndTest( 'build/slpkg',
+                    find_files('source/slpkg/','*.scm'),
+                    find_files('tests/slpkg/','*.scm') )
+
+# SCLPL Assembler
+SchemeBuildAndTest( 'build/slas',
+                    find_files('source/slas/','*.scm'),
+                    find_files('tests/slas/','*.scm') )
 
 # SCLPL Virtual Machine
 c_cpp.Program('build/slvm',