about summary refs log tree commit diff stats
path: root/build_until
diff options
context:
space:
mode:
authorKartik K. Agaram <vc@akkartik.com>2016-08-29 22:22:45 -0700
committerKartik K. Agaram <vc@akkartik.com>2016-08-29 22:22:45 -0700
commit3e4658e72d7bfe7ca40e22a2194c8a8278a2c089 (patch)
tree9bc063114eea6527107f31b93d380b681cf81316 /build_until
parenta800400c360c302a06c4127a34023b92244bcbf6 (diff)
downloadmu-3e4658e72d7bfe7ca40e22a2194c8a8278a2c089.tar.gz
3282
Fix CI process after recent changes. CI still will not be actually
*making use* of separate compilation (as it shouldn't).

As a side effect, 'build_until' shows a simpler (but still working!)
process for building Mu. Vast improvement over the previous hack of
dipping selectively into the Makefile.
Diffstat (limited to 'build_until')
-rwxr-xr-xbuild_until32
1 files changed, 27 insertions, 5 deletions
diff --git a/build_until b/build_until
index 2b75d792..af35e929 100755
--- a/build_until
+++ b/build_until
@@ -2,13 +2,35 @@
 # Load all files sorting before the given argument.
 # You can pass in a prefix, but files matching the prefix *won't* be included.
 
+# We'll avoid using cleave/ here and use the old flow for building everything
+# every single time:
+#
+#   layers -> mu.cc -> mu_bin
+#           |        |
+#         tangle    g++
+#
+# This has the nice side-effect of acting like an earlier/simpler 'layer' for
+# the build system.
+
 set -e
 set -v
-make --no-print-directory tangle/tangle
-make --no-print-directory enumerate/enumerate
 
-./tangle/tangle $(./enumerate/enumerate --until $1 |grep -v '.mu$') |grep -v "^\s*//:" > mu.cc
+( cd enumerate && make; )
+( cd tangle && make; )
+
+# build mu_bin
+./tangle/tangle $(./enumerate/enumerate --until ${1:-zzz} |grep -v '.mu$') > mu.cc
+
+( cd termbox && make; )
+
+grep -h "^[^[:space:]#].*) {$" mu.cc |grep -v ":.*(" |perl -pwe 's/ \{.*/;/' > function_list
+grep -v "^#line" mu.cc |grep -B1 "^{" |grep -v "^{" |perl -pwe 's/$/;/' >> function_list
+grep -h "^\s*TEST(" mu.cc |perl -pwe 's/^\s*TEST\((.*)\)$/void test_$1();/' >> function_list
+
+grep -h "^\s*void test_" mu.cc |perl -pwe 's/^\s*void (.*)\(\) \{.*/$1,/' > test_list
+grep -h "^\s*TEST(" mu.cc |perl -pwe 's/^\s*TEST\((.*)\)$/test_$1,/' >> test_list
 
-cat /dev/null $(./enumerate/enumerate --until $1 |grep '.mu$') > core.mu
+eval ${CXX:-c++} ${CFLAGS:-"-g -O3"} -Wall -Wextra -ftrapv -fno-strict-aliasing mu.cc termbox/libtermbox.a -o mu_bin
 
-CXXFLAGS=${CXXFLAGS:-"-g -O3"} make
+# build core.mu
+cat /dev/null $(./enumerate/enumerate --until ${1:-zzz} |grep '.mu$') > core.mu