about summary refs log tree commit diff stats
path: root/build0
diff options
context:
space:
mode:
Diffstat (limited to 'build0')
-rw-r--r--build013
1 files changed, 13 insertions, 0 deletions
diff --git a/build0 b/build0
index 20344bdf..efcbfcd3 100644
--- a/build0
+++ b/build0
@@ -5,14 +5,22 @@ set -v
 set -e  # stop immediately on error
 
 cd tangle
+  # auto-generate various lists (ending in '_list' by convention) {
+  # list of types
   {
     grep -h "^struct .* {" [0-9]*.cc  |sed 's/\(struct *[^ ]*\).*/\1;/'
     grep -h "^typedef " [0-9]*.cc
   }  > type_list
+  # list of function declarations, so I can define them in any order
   grep -h "^[^ #].*) {" [0-9]*.cc  |sed 's/ {.*/;/'  > function_list
+  # list of code files to compile
   ls [0-9]*.cc  |grep -v "\.test\.cc$"  |sed 's/.*/#include "&"/'  > file_list
+  # list of test files to compile
   ls [0-9]*.test.cc  |sed 's/.*/#include "&"/'  > test_file_list
+  # list of tests to run
   grep -h "^[[:space:]]*void test_" [0-9]*.cc  |sed 's/^\s*void \(.*\)() {$/\1,/'  > test_list
+  # }
+  # Now that we have all the _lists, compile 'tangle'
   g++ -g -O3 boot.cc -o tangle
 cd ..
 
@@ -23,7 +31,12 @@ cd termbox
 cd ..
 
 ./tangle/tangle [0-9]*.cc > mu.cc
+# auto-generate function declarations, so I can define them in any order
+# functions start out unindented, have all args on the same line, and end in ') {'
+#
+#                                      \/ ignore methods
 grep -h "^[^[:space:]#].*) {$" mu.cc  |grep -v ":.*("  |sed 's/ {.*/;/'  > function_list
+# auto-generate list of tests to run
 grep -h "^\s*void test_" mu.cc  |sed 's/^\s*void \(.*\)() {.*/\1,/'  > test_list
 g++ -g -O3 mu.cc termbox/libtermbox.a -o mu_bin