From 96d4f11b562159033661ebb9dc7f260274a8ac79 Mon Sep 17 00:00:00 2001 From: John Levon Date: Wed, 2 Dec 2020 12:20:45 +0000 Subject: add pre-push target (#150) Add a target that builds in debug and release mode and runs the tests in each. Signed-off-by: John Levon Reviewed-by: Thanos Makatos --- Makefile | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index 872c975..4375c57 100644 --- a/Makefile +++ b/Makefile @@ -38,7 +38,7 @@ else endif ifeq ($(VERBOSE),) - MAKEFLAGS += -s + MAKEFLAGS += -s endif BUILD_DIR_BASE = $(CURDIR)/build @@ -46,8 +46,7 @@ BUILD_DIR = $(BUILD_DIR_BASE)/$(BUILD_TYPE) INSTALL_PREFIX ?= /usr/local -PHONY_TARGETS := all realclean buildclean force_cmake export install-export tags - +PHONY_TARGETS := all test pre-push realclean buildclean force_cmake tags .PHONY: $(PHONY_TARGETS) all $(filter-out $(PHONY_TARGETS), $(MAKECMDGOALS)): $(BUILD_DIR)/Makefile @@ -56,6 +55,10 @@ all $(filter-out $(PHONY_TARGETS), $(MAKECMDGOALS)): $(BUILD_DIR)/Makefile test: all cd $(BUILD_DIR)/test; ctest --verbose +pre-push: realclean + make test + make test BUILD_TYPE=rel + realclean: rm -rf $(BUILD_DIR_BASE) -- cgit v1.1