From 8e15f9571a156bc8b6aadc3550d6802de0a86f69 Mon Sep 17 00:00:00 2001 From: "Dirk-Jan C. Binnema" Date: Mon, 12 Dec 2022 23:51:31 +0200 Subject: [PATCH] build: support MU_HACKER for debug builds When env var MU_HACKER is set, do a debug build. --- Makefile | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/Makefile b/Makefile index 411233d7..6af70609 100644 --- a/Makefile +++ b/Makefile @@ -26,6 +26,11 @@ ifneq ($(V),0) VERBOSE=--verbose endif +# when MU_HACKER is set, do a debug build +ifneq (${MU_HACKER},) +MESON_FLAGS:=$(MESON_FLAGS) '-Dbuildtype=debug' +endif + .PHONY: all .PHONY: check test test-verbose-if-fail test-valgrind test-helgrind @@ -39,15 +44,15 @@ endif # 1. build with clang, and the thread-sanitizer # make clean all MESON_FLAGS="-Db_sanitize=thread" CXX=clang++ CC=clang all: $(BUILDDIR) - $(NINJA) -C $(BUILDDIR) $(VERBOSE) + @$(NINJA) -C $(BUILDDIR) $(VERBOSE) $(BUILDDIR): - $(MESON) $(MESON_FLAGS) $(BUILDDIR) + @$(MESON) $(MESON_FLAGS) $(BUILDDIR) check: test test: all - $(MESON) test $(VERBOSE) -C $(BUILDDIR) + @$(MESON) test $(VERBOSE) -C $(BUILDDIR) install: $(BUILDDIR) @@ -73,9 +78,9 @@ test-valgrind: $(BUILDDIR) # we do _not_ pass helgrind; but this seems to be a false-alarm # https://gitlab.gnome.org/GNOME/glib/-/issues/2662 # test-helgrind: $(BUILDDIR) -# @cd $(BUILDDIR); TEST=HELGRIND $(MESON) test \ -# --wrap='valgrind --tool=helgrind --error-exitcode=1' \ -# --timeout-multiplier 100 +# @cd $(BUILDDIR); TEST=HELGRIND $(MESON) test \ +# --wrap='valgrind --tool=helgrind --error-exitcode=1' \ +# --timeout-multiplier 100 benchmark: $(BUILDDIR) $(NINJA) -C $(BUILDDIR) benchmark