diff options
author | Kartik K. Agaram <vc@akkartik.com> | 2018-03-13 09:04:07 -0700 |
---|---|---|
committer | Kartik K. Agaram <vc@akkartik.com> | 2018-03-13 09:04:07 -0700 |
commit | 5763322b9cc8cf8c8caed6b62919a680ed907c9a (patch) | |
tree | 59f8ed25317587fb6c0b61676d7a0a18358fdd21 /build1 | |
parent | 075498ec164b53600cf33d8fd070c003b1dc8cdf (diff) | |
download | mu-5763322b9cc8cf8c8caed6b62919a680ed907c9a.tar.gz |
4221 - more docs about build process
Diffstat (limited to 'build1')
-rw-r--r-- | build1 | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/build1 b/build1 index 3aeb52ee..56336f8c 100644 --- a/build1 +++ b/build1 @@ -23,14 +23,22 @@ export CFLAGS="$CFLAGS -Wall -Wextra -ftrapv -fno-strict-aliasing" $CXX $CFLAGS enumerate/enumerate.cc -o enumerate/enumerate 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' $CXX $CFLAGS boot.cc -o tangle cd .. @@ -42,7 +50,12 @@ cd .. LAYERS=$(./enumerate/enumerate --until $UNTIL_LAYER |grep '\.cc$') ./tangle/tangle $LAYERS > 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 $CXX $CFLAGS mu.cc termbox/libtermbox.a -o mu_bin |