about summary refs log tree commit diff stats
path: root/subx/build
diff options
context:
space:
mode:
Diffstat (limited to 'subx/build')
-rwxr-xr-xsubx/build51
1 files changed, 28 insertions, 23 deletions
diff --git a/subx/build b/subx/build
index 94698444..79f7707b 100755
--- a/subx/build
+++ b/subx/build
@@ -102,32 +102,37 @@ grep -h "^[^[:space:]#].*) {$" subx.cc  |grep -v ":.*("  |sed 's/ {.*/;/'  |upda
 grep -h "^\s*void test_" subx.cc  |sed 's/^\s*void \(.*\)() {.*/\1,/'  |update test_list
 grep -h "^\s*void test_" subx.cc  |sed 's/^\s*void \(.*\)() {.*/"\1",/'  |update test_name_list
 
-older_than subx_bin subx.cc *_list && {
-  $CXX $CFLAGS subx.cc -o subx_bin
-}
+if [ $# -eq 0 ]
+then
 
-# simple example programs
-for n in `seq 1 12`
-do
-  older_than examples/ex$n examples/ex$n.subx subx_bin && {
-    ./subx_bin translate examples/ex$n.subx -o examples/ex$n
+  older_than subx_bin subx.cc *_list && {
+    $CXX $CFLAGS subx.cc -o subx_bin
   }
-done
 
-# simple apps that use the standard library
-for app in factorial crenshaw2-1 crenshaw2-1b handle
-do
-  older_than apps/$app apps/$app.subx [0-9]*.subx && {
-    ./subx_bin translate [0-9]*.subx apps/$app.subx -o apps/$app
-  }
-done
+  # simple example programs
+  for n in `seq 1 12`
+  do
+    older_than examples/ex$n examples/ex$n.subx subx_bin && {
+      ./subx_bin translate examples/ex$n.subx -o examples/ex$n
+    }
+  done
 
-# self-hosting translator
-for phase in hex survey pack assort dquotes tests
-do
-  older_than apps/$phase apps/$phase.subx apps/subx-common.subx [0-9]*.subx && {
-    ./subx_bin translate [0-9]*.subx apps/subx-common.subx apps/$phase.subx -o apps/$phase
-  }
-done
+  # simple apps that use the standard library
+  for app in factorial crenshaw2-1 crenshaw2-1b handle
+  do
+    older_than apps/$app apps/$app.subx [0-9]*.subx && {
+      ./subx_bin translate [0-9]*.subx apps/$app.subx -o apps/$app
+    }
+  done
+
+  # self-hosting translator
+  for phase in hex survey pack assort dquotes tests
+  do
+    older_than apps/$phase apps/$phase.subx apps/subx-common.subx [0-9]*.subx && {
+      ./subx_bin translate [0-9]*.subx apps/subx-common.subx apps/$phase.subx -o apps/$phase
+    }
+  done
+
+fi
 
 exit 0