From 9dc9b4ee3aad18832fce71a2d40c8dc87d43f80d Mon Sep 17 00:00:00 2001 From: Stefano Lattarini Date: Sat, 28 Jul 2012 00:52:45 +0200 Subject: [PATCH] [ng] refactor: use new function 'am.vars.is-undef' ... * lib/am/header-vars.am (SUBDIRS): ... in the definition of this (instead of using hand-rolled almost-equivalent) ... ($(1)LOG_DRIVER, TEST_EXTENSIONS): ... and of these (instead of resorting to weaker and unsafer '?=' assignment). Signed-off-by: Stefano Lattarini --- lib/am/header-vars.am | 8 ++------ lib/am/parallel-tests.am | 13 +++++++------ 2 files changed, 9 insertions(+), 12 deletions(-) diff --git a/lib/am/header-vars.am b/lib/am/header-vars.am index 6bbde638a..fc3d3cf55 100644 --- a/lib/am/header-vars.am +++ b/lib/am/header-vars.am @@ -99,12 +99,8 @@ endef # Neutralize unwarranted environment settings that might interfere with # our Makefiles. -ifdef SUBDIRS - ifneq "$(origin SUBDIRS)" "file" - ifneq "$(origin SUBDIRS)" "command line" - SUBDIRS := - endif - endif +ifeq ($(call am.vars.is-undef,SUBDIRS),yes) + SUBDIRS := endif # CDPATH is only useful in interactive usage, and should never be exported diff --git a/lib/am/parallel-tests.am b/lib/am/parallel-tests.am index bb4ce6463..43daeef4b 100644 --- a/lib/am/parallel-tests.am +++ b/lib/am/parallel-tests.am @@ -66,9 +66,9 @@ am__tpfx = \ define am.test-suite.handle-suffix -# FIXME: This will pick up the default from the environment; are we sure -# FIXME: we want that? -$$(call am__tpfx,$1)LOG_DRIVER ?= $(SHELL) $(am.conf.aux-dir)/test-driver +ifeq ($$(call am.vars.is-undef,$$(call am__tpfx,$1)LOG_DRIVER),yes) +$$(call am__tpfx,$1)LOG_DRIVER = $(SHELL) $(am.conf.aux-dir)/test-driver +endif %.log %.trs: %$1 $$($$(call am__tpfx,$1)LOG_DEPENDENCIES) @$$(call am.test-suite.runtest,$$(call am__tpfx,$1)) @@ -82,9 +82,10 @@ endif # am.conf.handle-exeext = yes endef # am.test-suite.handle-suffix -# FIXME: this will pick up the default from the environment; are we sure -# FIXME: we want that? -TEST_EXTENSIONS ?= .test +ifeq ($(call am.vars.is-undef,TEST_EXTENSIONS),yes) + TEST_EXTENSIONS := .test +endif + $(foreach e,$(filter-out .%,$(TEST_EXTENSIONS)),\ $(call am.error,invalid test extension: '$e')) $(foreach e,$(TEST_EXTENSIONS), \ -- 2.47.2