From b4785580be3fd46f18e21ee8c92759d5481432ed Mon Sep 17 00:00:00 2001 From: "Kartik K. Agaram" Date: Thu, 6 Oct 2016 17:13:04 -0700 Subject: 3450 Purge remaining `makefile`s, without breaking CI. --- build | 8 ++++++-- build_and_test_until | 2 +- build_until | 32 -------------------------------- enumerate/makefile | 5 ----- tangle/makefile | 25 ------------------------- termbox/makefile | 9 --------- test_layers | 3 ++- 7 files changed, 9 insertions(+), 75 deletions(-) delete mode 100755 build_until delete mode 100644 enumerate/makefile delete mode 100644 tangle/makefile delete mode 100644 termbox/makefile diff --git a/build b/build index 86f9fa5f..3b12d6eb 100755 --- a/build +++ b/build @@ -5,6 +5,10 @@ set -e # stop immediately on error # (layers) | | | | # tangle cleave $CXX $CXX +# can also be called with a layer to only build until +# $ ./build --until 050 +UNTIL_LAYER=${2:-zzz} + test $CXX || export CXX=c++ test $CC || export CC=cc test $CFLAGS || export CFLAGS="-g -O3" @@ -62,7 +66,7 @@ noisy_cd tangle } noisy_cd .. -LAYERS=$(./enumerate/enumerate --until zzz |grep -v '.mu$') +LAYERS=$(./enumerate/enumerate --until $UNTIL_LAYER |grep -v '.mu$') older_than mu.cc $LAYERS enumerate/enumerate tangle/tangle || { ./tangle/tangle $LAYERS > mu.cc } @@ -111,7 +115,7 @@ older_than mu_bin mu.cc *_list cleave/cleave || { ## [0-9]*.mu -> core.mu -MU_LAYERS=$(./enumerate/enumerate --until zzz |grep '.mu$') +MU_LAYERS=$(./enumerate/enumerate --until $UNTIL_LAYER |grep '.mu$') || exit 0 # ok if no .mu files older_than core.mu $MU_LAYERS || { cat $MU_LAYERS > core.mu } diff --git a/build_and_test_until b/build_and_test_until index 4fc9d38b..a69ad352 100755 --- a/build_and_test_until +++ b/build_and_test_until @@ -1,3 +1,3 @@ #!/bin/bash -./build_until $1 && ./mu_bin test +./build --until $1 && ./mu_bin test diff --git a/build_until b/build_until deleted file mode 100755 index 520ec16a..00000000 --- a/build_until +++ /dev/null @@ -1,32 +0,0 @@ -#!/bin/bash -# 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 - -( 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 ":.*(" |sed 's/ {.*/;/' > function_list -grep -h "^\s*void test_" mu.cc |sed 's/^\s*void \(.*\)() {.*/\1,/' > test_list - -eval ${CXX:-c++} ${CXXFLAGS:-"-g -O3"} -Wall -Wextra -ftrapv -fno-strict-aliasing mu.cc termbox/libtermbox.a -o mu_bin - -# build core.mu -cat /dev/null $(./enumerate/enumerate --until ${1:-zzz} |grep '.mu$') > core.mu diff --git a/enumerate/makefile b/enumerate/makefile deleted file mode 100644 index e1a06f63..00000000 --- a/enumerate/makefile +++ /dev/null @@ -1,5 +0,0 @@ -enumerate: makefile enumerate.cc - c++ -O3 -Wall -Wextra -fno-strict-aliasing enumerate.cc -o enumerate - -clean: - -rm enumerate diff --git a/tangle/makefile b/tangle/makefile deleted file mode 100644 index 2b22e809..00000000 --- a/tangle/makefile +++ /dev/null @@ -1,25 +0,0 @@ -tangle: makefile type_list function_list file_list test_file_list test_list - c++ -O3 -Wall -Wextra -fno-strict-aliasing boot.cc -o tangle - -type_list: boot.cc [0-9]*.cc - @# assumes struct decl has space before '{' - @grep -h "^struct .* {" [0-9]*.cc |sed 's/\(struct *[^ ]*\).*/\1;/' > type_list - @grep -h typedef [0-9]*.cc >> type_list - -function_list: boot.cc [0-9]*.cc - @# assumes function decl has space before '{' - @grep -h "^[^ #].*) {" [0-9]*.cc |sed 's/ {.*/;/' > function_list - -file_list: boot.cc [0-9]*.cc - @ls [0-9]*.cc |grep -v "\.test\.cc$$" |sed 's/.*/#include "&"/' > file_list - -test_file_list: [0-9]*.test.cc - @ls [0-9]*.test.cc |sed 's/.*/#include "&"/' > test_file_list - -test_list: [0-9]*.cc - @grep -h "^[[:space:]]*void test_" [0-9]*.cc |sed 's/^\s*void \(.*\)() {$$/\1,/' > test_list - -.PHONY: clean - -clean: - -rm tangle *_list diff --git a/termbox/makefile b/termbox/makefile deleted file mode 100644 index 3ee05b69..00000000 --- a/termbox/makefile +++ /dev/null @@ -1,9 +0,0 @@ -CFLAGS=-O3 -Wall -Wextra - -libtermbox.a: utf8.o termbox.o - ar rcs libtermbox.a *.o - -termbox.o: termbox.h termbox.c input.inl output.inl bytebuffer.inl - -clean: - -rm *.o libtermbox.a diff --git a/test_layers b/test_layers index 2d1dae8e..a59f4064 100755 --- a/test_layers +++ b/test_layers @@ -27,7 +27,8 @@ do if [[ $f < $1 ]]; then continue; fi if [[ $2 && $f > $2 ]]; then exit 0; fi echo "=== $f" - ./build_until $f || exit 1 + rm -rf .build mu.cc mu_bin # force full rebuild for top-level, but not subsidiary tools like tangle and cleave + ./build --until $f || exit 1 valgrind --leak-check=yes --num-callers=40 -q --error-exitcode=1 ./mu_bin test || exit 1 done -- cgit 1.4.1-2-gfad0