about summary refs log tree commit diff stats
path: root/cpp/makefile
diff options
context:
space:
mode:
authorKartik K. Agaram <vc@akkartik.com>2015-02-16 15:27:02 -0800
committerKartik K. Agaram <vc@akkartik.com>2015-02-16 15:27:49 -0800
commit88663269262e882f63df23ea0ce93f3e95d74a2c (patch)
treeba16f4022e8c50d597972d3596932feed0232046 /cpp/makefile
parentf42a8ddc38ec6438c70f7ad5a2b3db3e29280f8e (diff)
downloadmu-88663269262e882f63df23ea0ce93f3e95d74a2c.tar.gz
763 - start of C++ version
Diffstat (limited to 'cpp/makefile')
-rw-r--r--cpp/makefile23
1 files changed, 23 insertions, 0 deletions
diff --git a/cpp/makefile b/cpp/makefile
new file mode 100644
index 00000000..1c7e1380
--- /dev/null
+++ b/cpp/makefile
@@ -0,0 +1,23 @@
+mu: makefile type_list function_list file_list test_file_list test_list
+	g++ -O3 -Wall -Wextra -fno-strict-aliasing boot.cc -o mu
+
+type_list: boot.cc [0-9]*.cc
+	@# assumes struct decl has space before '{'
+	@grep -h "^struct .* {" [0-9]*.cc |perl -pwe '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 |perl -pwe 's/ {.*/;/' > function_list
+
+file_list: boot.cc [0-9]*.cc
+	@ls [0-9]*.cc |grep -v "\.test\.cc$$" |perl -pwe 's/.*/#include "$$&"/' > file_list
+
+test_file_list: [0-9]*.test.cc
+	@ls [0-9]*.test.cc |perl -pwe 's/.*/#include "$$&"/' > test_file_list
+
+test_list: [0-9]*.cc
+	@grep -h "^[[:space:]]*void test_" [0-9]*.cc |perl -pwe 's/^\s*void (.*)\(\) {$$/$$1,/' > test_list
+
+clean:
+	rm -rf mu* *_list