diff options
author | Kartik K. Agaram <vc@akkartik.com> | 2016-09-10 09:55:44 -0700 |
---|---|---|
committer | Kartik K. Agaram <vc@akkartik.com> | 2016-09-10 09:55:44 -0700 |
commit | 7303b27fe555644daf45b89e9feb1908f1f085e4 (patch) | |
tree | 5f9f50fa026a84974cba6cf1df0ce1f4b16cc1ed /makefile | |
parent | 3556a31e67a07f832afd06c930d9573132468480 (diff) | |
download | mu-7303b27fe555644daf45b89e9feb1908f1f085e4.tar.gz |
3312
Diffstat (limited to 'makefile')
-rw-r--r-- | makefile | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/makefile b/makefile index 86d9fab9..5b7aa4e9 100644 --- a/makefile +++ b/makefile @@ -18,6 +18,7 @@ mu_bin: mu.cc makefile function_list test_list cleave/cleave @cp function_list test_list .build @mkdir -p .build/termbox @cp termbox/termbox.h .build/termbox + @# split mu.cc into separate compilation units under .build/ to speed up recompiles ./cleave/cleave mu.cc .build @# recursive (potentially parallel) make to pick up BUILD_SRC after cleave @make .build/mu_bin @@ -51,7 +52,7 @@ termbox/libtermbox.a: termbox/*.c termbox/*.h termbox/*.inl # auto-generated files; by convention they end in '_list'. -# autogenerated list of function declarations, so I can define them in any order +# auto-generated list of function declarations, so I can define them in any order function_list: mu.cc @# functions start out unindented, have all args on the same line, and end in ') {' @# ignore methods @@ -62,13 +63,15 @@ function_list: mu.cc @# test functions @grep -h "^\s*TEST(" mu.cc |perl -pwe 's/^\s*TEST\((.*)\)$$/void test_$$1();/' >> function_list -# autogenerated list of tests to run +# auto-generated list of tests to run test_list: mu.cc @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 +# auto-generated list of extern declarations to global variables +# for separate compilation .build/global_declarations_list: .build/global_definitions_list - grep ';' .build/global_definitions_list |perl -pwe 's/[=(].*/;/' |perl -pwe 's/^[^\/# ]/extern $$&/' |perl -pwe 's/^extern extern /extern /' > .build/global_declarations_list + @grep ';' .build/global_definitions_list |perl -pwe 's/[=(].*/;/' |perl -pwe 's/^[^\/# ]/extern $$&/' |perl -pwe 's/^extern extern /extern /' > .build/global_declarations_list .PHONY: all clean clena |