diff options
Diffstat (limited to 'build3')
-rwxr-xr-x | build3 | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/build3 b/build3 index 9c125c57..f73a5175 100755 --- a/build3 +++ b/build3 @@ -111,14 +111,22 @@ older_than enumerate/enumerate enumerate/enumerate.cc && { older_than tangle/tangle tangle/*.cc && { noisy_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 } |update type_list + # list of function declarations, so I can define them in any order grep -h "^[^ #].*) {" [0-9]*.cc |sed 's/ {.*/;/' |update function_list + # list of code files to compile ls [0-9]*.cc |grep -v "\.test\.cc$" |sed 's/.*/#include "&"/' |update file_list + # list of test files to compile ls [0-9]*.test.cc |sed 's/.*/#include "&"/' |update test_file_list + # list of tests to run grep -h "^[[:space:]]*void test_" [0-9]*.cc |sed 's/^\s*void \(.*\)() {$/\1,/' |update test_list + # } + # Now that we have all the _lists, compile 'tangle' $CXX $CFLAGS boot.cc -o tangle noisy_cd .. # no effect; just to show us returning to the parent directory } @@ -135,7 +143,12 @@ older_than cleave/cleave cleave/cleave.cc && { } mkdir -p .build +# 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/ {.*/;/' |update .build/function_list +# auto-generate list of tests to run 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 @@ -143,6 +156,7 @@ 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 + # create the list of global variable declarations from the corresponding definitions grep ';' global_definitions_list |sed 's/[=(].*/;/' |sed 's/^[^\/# ]/extern &/' |sed 's/^extern extern /extern /' |update global_declarations_list for f in mu_*.cc do |