about summary refs log tree commit diff stats
path: root/build
diff options
context:
space:
mode:
authorKartik K. Agaram <vc@akkartik.com>2016-12-26 15:57:46 -0800
committerKartik K. Agaram <vc@akkartik.com>2016-12-26 15:57:46 -0800
commite35c2d6857e1ed916221faae707e3c53ff8ed042 (patch)
tree0c17ed8d97430e815abac11e8d82b55aee80ef61 /build
parent53fbba4f64d158ee79c6dc0cc25535f51a226187 (diff)
downloadmu-e35c2d6857e1ed916221faae707e3c53ff8ed042.tar.gz
3712
Let's start highlighting pipe stages better in shell scripts.
Diffstat (limited to 'build')
-rwxr-xr-xbuild30
1 files changed, 15 insertions, 15 deletions
diff --git a/build b/build
index 15af4d65..abd8cded 100755
--- a/build
+++ b/build
@@ -53,7 +53,7 @@ update() {
     cat > $1
   else
     cat > $1.tmp
-    diff -q $1 $1.tmp >/dev/null && rm $1.tmp || mv $1.tmp $1
+    diff -q $1 $1.tmp >/dev/null  &&  rm $1.tmp  ||  mv $1.tmp $1
   fi
 }
 
@@ -79,18 +79,18 @@ older_than enumerate/enumerate enumerate/enumerate.cc && {
 older_than tangle/tangle tangle/*.cc && {
   noisy_cd tangle
     {
-      grep -h "^struct .* {" [0-9]*.cc |sed 's/\(struct *[^ ]*\).*/\1;/'
+      grep -h "^struct .* {" [0-9]*.cc  |sed 's/\(struct *[^ ]*\).*/\1;/'
       grep -h "^typedef " [0-9]*.cc
-    } |update type_list
-    grep -h "^[^ #].*) {" [0-9]*.cc |sed 's/ {.*/;/' |update function_list
-    ls [0-9]*.cc |grep -v "\.test\.cc$" |sed 's/.*/#include "&"/' |update file_list
-    ls [0-9]*.test.cc |sed 's/.*/#include "&"/' |update test_file_list
-    grep -h "^[[:space:]]*void test_" [0-9]*.cc |sed 's/^\s*void \(.*\)() {$/\1,/' |update test_list
+    }  |update type_list
+    grep -h "^[^ #].*) {" [0-9]*.cc  |sed 's/ {.*/;/'  |update function_list
+    ls [0-9]*.cc  |grep -v "\.test\.cc$"  |sed 's/.*/#include "&"/'  |update file_list
+    ls [0-9]*.test.cc  |sed 's/.*/#include "&"/'  |update test_file_list
+    grep -h "^[[:space:]]*void test_" [0-9]*.cc  |sed 's/^\s*void \(.*\)() {$/\1,/'  |update test_list
     $CXX $CFLAGS boot.cc -o tangle
   noisy_cd ..  # no effect; just to show us returning to the parent directory
 }
 
-LAYERS=$(./enumerate/enumerate --until $UNTIL_LAYER |grep -v '.mu$')
+LAYERS=$(./enumerate/enumerate --until $UNTIL_LAYER  |grep -v '.mu$')
 older_than mu.cc $LAYERS enumerate/enumerate tangle/tangle && {
   # exception to the rules above: we combine 'older_than' and 'update' here
   # because we sometimes want to hack directly on mu.cc and not lose our
@@ -98,7 +98,7 @@ older_than mu.cc $LAYERS enumerate/enumerate tangle/tangle && {
 
   # shorter version but continues unnecessarily if tangle dies
   #   ./tangle/tangle $LAYERS |update mu.cc
-  ./tangle/tangle $LAYERS > mu_tmp.cc  # die if this fails
+  ./tangle/tangle $LAYERS  > mu_tmp.cc  # die if this fails
   cat mu_tmp.cc |update mu.cc
   rm mu_tmp.cc
 }
@@ -109,18 +109,18 @@ older_than cleave/cleave cleave/cleave.cc && {
 }
 
 mkdir -p .build
-grep -h "^[^[:space:]#].*) {$" mu.cc |grep -v ":.*(" |sed 's/ {.*/;/' |update .build/function_list
-grep -h "^\s*void test_" mu.cc |sed 's/^\s*void \(.*\)() {.*/\1,/' |update .build/test_list
+grep -h "^[^[:space:]#].*) {$" mu.cc  |grep -v ":.*("  |sed 's/ {.*/;/'  |update .build/function_list
+grep -h "^\s*void test_" mu.cc  |sed 's/^\s*void \(.*\)() {.*/\1,/'  |update .build/test_list
 mkdir -p .build/termbox
 update_cp termbox/termbox.h .build/termbox
 
 older_than mu_bin mu.cc *_list cleave/cleave termbox/* && {
   ./cleave/cleave mu.cc .build
   noisy_cd .build
-    grep ';' global_definitions_list |sed 's/[=(].*/;/' |sed 's/^[^\/# ]/extern &/' |sed 's/^extern extern /extern /' |update global_declarations_list
+    grep ';' global_definitions_list  |sed 's/[=(].*/;/'  |sed 's/^[^\/# ]/extern &/'  |sed 's/^extern extern /extern /'  |update global_declarations_list
     for f in mu_*.cc
     do
-      older_than `echo $f |sed 's/\.cc$/.o/'` $f header global_declarations_list function_list test_list && {
+      older_than `echo $f  |sed 's/\.cc$/.o/'` $f header global_declarations_list function_list test_list && {
         $CXX $CFLAGS -c $f
       }
     done
@@ -141,8 +141,8 @@ older_than mu_bin mu.cc *_list cleave/cleave termbox/* && {
 
 ## [0-9]*.mu -> core.mu
 
-MU_LAYERS=$(./enumerate/enumerate --until $UNTIL_LAYER |grep '.mu$') || exit 0  # ok if no .mu files
-cat $MU_LAYERS |update core.mu
+MU_LAYERS=$(./enumerate/enumerate --until $UNTIL_LAYER  |grep '.mu$') || exit 0  # ok if no .mu files
+cat $MU_LAYERS  |update core.mu
 
 exit 0