]> git.mdlowis.com Git - proto/sclpl.git/commitdiff
Fully functional scheme builders
authorMike D. Lowis <mike.lowis@gentex.com>
Fri, 14 Jun 2013 14:01:04 +0000 (10:01 -0400)
committerMike D. Lowis <mike.lowis@gentex.com>
Fri, 14 Jun 2013 14:01:04 +0000 (10:01 -0400)
SConstruct

index 227c6e2801cf75056aac3d746ae3a31c5e1f355a..035a6fbd39918faf31d98089eb099b5035dccb08 100644 (file)
@@ -14,16 +14,25 @@ def find_files(dir,pattern):
             matches.append(os.path.join(root, filename))
     return matches
 
-# Scheme program builder
-scheme_builder = Builder(
-    action = 'csc -o $TARGET $SOURCE',
-    suffix = '.exe' if (platform.system() == 'Windows') else ''
+# Scheme Source Compiler
+scheme_compiler = Builder(
+    action     = 'csc -c -o $TARGET $SOURCE',
+    suffix     = '.o',
+    src_suffix = '.scm',
+    single_source = True
+)
+
+# Scheme Binary Linker
+scheme_linker = Builder(
+    action  = 'csc -o $TARGET $SOURCE',
+    suffix = "$PROGSUFFIX",
+    src_builder = [ scheme_compiler ]
 )
 
 # Create the Environment for this project
 env = Environment(
-    ENV = os.environ,
-    BUILDERS = { 'SchemeProgram': scheme_builder }
+        ENV = os.environ,
+        BUILDERS = { 'SchemeProgram': scheme_linker }
 )
 
 #------------------------------------------------------------------------------
@@ -32,7 +41,7 @@ env = Environment(
 
 # SCLPL Compiler
 env.SchemeProgram(
-    target = 'sclpl-cc.exe',
+    target = 'sclpl-cc',
     source = find_files('source/compiler/','*.scm')
 )