diff options
Diffstat (limited to 'makefile')
-rw-r--r-- | makefile | 35 |
1 files changed, 7 insertions, 28 deletions
diff --git a/makefile b/makefile index 26259a40..a46a9c41 100644 --- a/makefile +++ b/makefile @@ -1,7 +1,10 @@ all: mu_bin core.mu +CXX ?= c++ +CFLAGS ?= -g -O3 + mu_bin: makefile enumerate/enumerate tangle/tangle mu.cc termbox/libtermbox.a - @make --no-print-directory dbg+opt + ${CXX} ${CFLAGS} -Wall -Wextra -fno-strict-aliasing mu.cc termbox/libtermbox.a -o mu_bin # To see what the program looks like after all layers have been applied, read # mu.cc @@ -40,34 +43,10 @@ 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 -# turning optimizations/profiling/sanitization-checking on/off -.PHONY: all autogenerated_lists test valgrind clang dbg opt prof opt+prof dbg+opt+prof clang+opt clena - -dbg: - c++ -g -Wall -Wextra -fno-strict-aliasing mu.cc termbox/libtermbox.a -o mu_bin - -opt: - c++ -O3 -Wall -Wextra -fno-strict-aliasing mu.cc termbox/libtermbox.a -o mu_bin - -dbg+opt: - c++ -g -O3 -Wall -Wextra -fno-strict-aliasing mu.cc termbox/libtermbox.a -o mu_bin - -prof: - c++ -pg -Wall -Wextra -fno-strict-aliasing mu.cc termbox/libtermbox.a -o mu_bin - -opt+prof: - c++ -O3 -pg -Wall -Wextra -fno-strict-aliasing mu.cc termbox/libtermbox.a -o mu_bin - -dbg+opt+prof: - c++ -g -O3 -pg -Wall -Wextra -fno-strict-aliasing mu.cc termbox/libtermbox.a -o mu_bin - -clang: - clang++ -g -fsanitize=undefined mu.cc termbox/libtermbox.a -o mu_bin - -clang+opt: - clang++ -O3 -fsanitize=undefined mu.cc termbox/libtermbox.a -o mu_bin +# +.PHONY: all autogenerated_lists clean clena -valgrind: clang+opt +valgrind: autogenerated_lists mu_bin core.mu valgrind --leak-check=yes -q --error-exitcode=1 ./mu_bin test clena: clean |