about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorKartik Agaram <github@akkartik.com>2020-10-25 12:58:17 -0700
committerGitHub <noreply@github.com>2020-10-25 12:58:17 -0700
commit4dad0efa8dfe7f7ce339f7d2d7b1aa817810665d (patch)
tree6424ae58fbdfef9c94dbac532f5c5e5f52adaa35
parente68dc9ccfb3f63c4c5ba60c63d87237854503b73 (diff)
parent5a23167d84367d851948c29006caaac3e19443dd (diff)
downloadmu-4dad0efa8dfe7f7ce339f7d2d7b1aa817810665d.tar.gz
Merge pull request #44 from tekknolagi/main
Clean up environment variables in `build`.
-rwxr-xr-xbuild11
1 files changed, 5 insertions, 6 deletions
diff --git a/build b/build
index f53f0619..073da720 100755
--- a/build
+++ b/build
@@ -20,9 +20,8 @@ UNTIL_LAYER=${2:-zzz}
 # risk: a file may unnecessarily update without changes, causing unnecessary work downstream
 
 test "$CXX" || export CXX=c++
-test "$CC" || export CC=cc
-test "$CFLAGS" || export CFLAGS="-g -O3 -std=c++98"  # CI has an ancient version; don't expect recent dialects
-export CFLAGS="$CFLAGS -Wall -Wextra -fno-strict-aliasing"
+test "$CXXFLAGS" || export CXXFLAGS="-g -O3 -std=c++98"  # CI has an ancient version; don't expect recent dialects
+export CXXFLAGS="$CXXFLAGS -Wall -Wextra -fno-strict-aliasing"
 
 # return 1 if $1 is older than _any_ of the remaining args
 older_than() {
@@ -73,7 +72,7 @@ noisy_cd() {
 }
 
 older_than tools/enumerate tools/enumerate.cc && {
-  $CXX $CFLAGS tools/enumerate.cc -o tools/enumerate
+  $CXX $CXXFLAGS tools/enumerate.cc -o tools/enumerate
 }
 
 older_than tools/tangle tools/tangle.cc && {
@@ -81,7 +80,7 @@ older_than tools/tangle tools/tangle.cc && {
     grep -h "^[^ #].*) {" tangle.cc  |sed 's/ {.*/;/'  |update tangle.function_list
     grep -h "^[[:space:]]*void test_" tangle.cc  |sed 's/^\s*void \(.*\)() {$/\1,/'  |update tangle.test_list
     grep -h "^\s*void test_" tangle.cc  |sed 's/^\s*void \(.*\)() {.*/"\1",/'  |update tangle.test_name_list
-    $CXX $CFLAGS tangle.cc -o tangle
+    $CXX $CXXFLAGS tangle.cc -o tangle
     ./tangle test
   noisy_cd ..  # no effect; just to show us returning to the parent directory
 }
@@ -97,7 +96,7 @@ grep -h "^\s*void test_" bootstrap.cc  |sed 's/^\s*void \(.*\)() {.*/\1,/'  |upd
 grep -h "^\s*void test_" bootstrap.cc  |sed 's/^\s*void \(.*\)() {.*/"\1",/'  |update test_name_list
 
 older_than bootstrap_bin bootstrap.cc *_list && {
-  $CXX $CFLAGS bootstrap.cc -o bootstrap_bin
+  $CXX $CXXFLAGS bootstrap.cc -o bootstrap_bin
   echo
 }