about summary refs log tree commit diff stats
path: root/cpp/makefile
blob: 4fbe6759ffd069bac8963df7b1814dadbec6d327 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11pre { line-height: 125%; }
td.linenos .normal { color: inherit; background-color: transparent; padding-left: 5px; padding-right: 5px; }
span.linenos { color: inherit; background-color: transparent; padding-left: 5px; padding-right: 5px; }
td.linenos .special { color: #000000; background-color: #ffffc0; padding-left: 5px; padding-right: 5px; }
span.linenos.special { color: #000000; background-color: #ffffc0; padding-left: 5px; padding-right: 5px; }
.highlight .hll { background-color: #ffffcc }
.highlight .c { color: #888888 } /* Comment */
.highlight .err { color: #a61717; background-colo
mu: makefile tangle/tangle mu.cc
	g++ -g -Wall -Wextra -fno-strict-aliasing mu.cc -o mu
	./mu test

# To see what the program looks like after all layers have been applied, read
# mu.cc
mu.cc: 0*
	./tangle/tangle --until 999 |grep -v "^\s*//:" > mu.cc
	@make autogenerated_lists >/dev/null

tangle/tangle:
	cd tangle && make && tangle test

# auto-generated files; by convention they end in '_list'.
.PHONY: autogenerated_lists clena
autogenerated_lists: mu.cc function_list test_list

function_list: mu.cc
	@grep -h "^[^ #].*) {" mu.cc |perl -pwe 's/ {.*/;/' > function_list
	@grep -h "^[[:space:]]*TEST(" mu.cc |perl -pwe 's/^\s*TEST\((.*)\)$$/void test_$$1();/' >> function_list

test_list: mu.cc
	@grep -h "^[[:space:]]*void test_" mu.cc |perl -pwe 's/^\s*void (.*)\(\) {.*/$$1,/' > test_list
	@grep -h "^[[:space:]]*TEST(" mu.cc |perl -pwe 's/^\s*TEST\((.*)\)$$/test_$$1,/' >> test_list

clena: clean
clean:
	cd tangle && make clean
	rm -rf mu.cc mu *_list