From 422c9bdbad34a21948dd32297d306fe5872c09fd Mon Sep 17 00:00:00 2001 From: Pavel Pisa Date: Thu, 7 Oct 2010 18:00:39 +0200 Subject: [PATCH] Makefile rules updated actual version from from OMK project. OMK homepage and repository http://rtime.felk.cvut.cz/omk/ Signed-off-by: Pavel Pisa --- omk/rules/linux/Makefile.rules | 39 ++++++++++++++++++++++++++++++++-- 1 file changed, 37 insertions(+), 2 deletions(-) diff --git a/omk/rules/linux/Makefile.rules b/omk/rules/linux/Makefile.rules index a887fa2..91ab006 100644 --- a/omk/rules/linux/Makefile.rules +++ b/omk/rules/linux/Makefile.rules @@ -4,7 +4,7 @@ # (C) Copyright 2006, 2007, 2008, 2009, 2010 by Michal Sojka - Czech Technical University, FEE, DCE # # Homepage: http://rtime.felk.cvut.cz/omk/ -# Version: 0.2-27-g254fd61 +# Version: 0.2-35-gb9c630c # # The OMK build system is distributed under the GNU General Public # License. See file COPYING for details. @@ -18,6 +18,8 @@ # W .. whole tree - if set to 1, make is always called from the top-level directory # SUBDIRS .. list of subdirectories intended for make from actual directory # default_CONFIG .. list of default config assignments CONFIG_XXX=y/n ... +# wvtest_SCRIPTS .. list of scripts producing wvtest output #OMK:wvtest.omk +# wvtest_PROGRAMS .. list of the testing programs producing wvtest output # LN_HEADERS .. if "y", header files are symbolicaly linked instead of copied. #OMK:include.omk # input variables #OMK:linux.omk # lib_LIBRARIES .. list of the user-space libraries @@ -338,6 +340,39 @@ omkize: cp -v Makefile "$${d}/Makefile"; \ fi \ done + #OMK:wvtest.omk@Makefile.rules.linux +# Documentation: wvtest_PROGRAMS is equivalent to test_PROGRAMS. The +# difference is that it is automatically run during "make wvtest". +test_PROGRAMS += $(wvtest_PROGRAMS) + +# Documentation: If your project uses wvtest, it is recomended to put +# the "test: wvtest" rule to config.target. +wvtest: + $(Q)$(MAKERULES_DIR)/wvtestrun $(MAKE) wvtest-pass + +.PHONY: wvtest + +$(eval $(call omk_pass_template,wvtest-pass,$$(LOCAL_BUILD_DIR),,$(wvtest_SCRIPTS)$(wvtest_PROGRAMS))) + +# Usage: $(call wvtest_template,) +define wvtest_template +wvtest-pass-local: wvtest-run-$(1) +.PHONY: wvtest-run-$(1) +wvtest-run-$(1): + mkdir -p $(1).wvtest + cd $(1).wvtest && $(1) +endef + +# Documentation: Write the test so, that it can be run from arbitrary +# directory, i.e. in case of a script ensure that the wvtest library +# is sourced like this: +# +# . $(dirname $0)/wvtest.sh + +$(foreach script,$(wvtest_SCRIPTS),$(eval $(call wvtest_template,$(SOURCES_DIR)/$(script)))) +# Hack!!! +USER_TESTS_DIR := $(OUTPUT_DIR)/_compiled/bin-tests +$(foreach prog,$(wvtest_PROGRAMS),$(eval $(call wvtest_template,$(USER_TESTS_DIR)/$(prog)))) ifeq ($(OMK_VERBOSE),1) #OMK:include.omk@Makefile.rules.linux CPHEADER_FLAGS += -v LNHEADER_FLAGS += -v @@ -347,7 +382,7 @@ ifneq ($(LN_HEADERS),y) define cp_cmd if ! cmp --quiet $(1) $(2); then \ echo " CP $(1:$(OUTPUT_DIR)/%=%) -> $(2:$(OUTPUT_DIR)/%=%)"; \ - install -C -D $(CPHEADER_FLAGS) $(1) $(2) || exit 1; \ + install -D $(CPHEADER_FLAGS) $(1) $(2) || exit 1; \ fi endef else -- 2.39.2