about summary refs log tree commit diff stats
path: root/makefile
diff options
context:
space:
mode:
Diffstat (limited to 'makefile')
-rw-r--r--makefile9
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