build: update Makefile.meson with some useful targets

For testing.
This commit is contained in:
Dirk-Jan C. Binnema 2022-02-18 07:11:18 +02:00
parent fe2b1693c1
commit d2e6cfdf70
1 changed files with 13 additions and 2 deletions

View File

@ -1,4 +1,4 @@
## Copyright (C) 2008-2021 Dirk-Jan C. Binnema <djcb@djcbsoftware.nl>
## Copyright (C) 2008-2022 Dirk-Jan C. Binnema <djcb@djcbsoftware.nl>
##
## This program is free software; you can redistribute it and/or modify
## it under the terms of the GNU General Public License as published by
@ -20,11 +20,18 @@ NINJA ?= ninja
BUILDDIR ?= $(CURDIR)/build
MESON ?= meson
# MESON_FLAGS, e.g. "-Dreadline=enabled"
# examples:
# 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)
$(BUILDDIR):
$(MESON) $(BUILDDIR)
$(MESON) $(MESON_FLAGS) $(BUILDDIR)
check: test
@ -34,6 +41,10 @@ test: $(BUILDDIR)
test-valgrind: $(BUILDDIR)
@cd $(BUILDDIR); $(MESON) test --wrap='valgrind --leak-check=full --error-exitcode=1'
test-helgrind: $(BUILDDIR)
@cd $(BUILDDIR); $(MESON) test --wrap='valgrind --tool=helgrind --error-exitcode=1'
dist: $(BUILDDIR)
@cd $(BUILDDIR); $(MESON) dist