From d997690aa5645ff2dd08c5ad794244806600a132 Mon Sep 17 00:00:00 2001 From: Andrew Johnson Date: Wed, 30 Dec 2020 12:57:26 -0600 Subject: [PATCH 1/2] Build: Fix tests for the 'make -s' flag 'make -j2' or more adds an 's' to MFLAGS in "--jobserver-fds". This is the correct way to do the check. --- configure/CONFIG_BASE | 2 +- configure/CONFIG_COMMON | 4 ++-- configure/os/CONFIG.Common.RTEMS | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/configure/CONFIG_BASE b/configure/CONFIG_BASE index 7c545c92d..757bd35e3 100644 --- a/configure/CONFIG_BASE +++ b/configure/CONFIG_BASE @@ -71,7 +71,7 @@ FULLPATHNAME = $(PERL) $(TOOLS)/fullPathName.pl #------------------------------------------------------- # tools for installing libraries and products -INSTALL_QUIETLY := $(if $(findstring s,$(MFLAGS)),-q,) +INSTALL_QUIETLY := $(if $(filter -s,$(MFLAGS)),-q,) INSTALL = $(PERL) $(TOOLS)/installEpics.pl $(INSTALL_QUIETLY) INSTALL_PRODUCT = $(INSTALL) INSTALL_LIBRARY = $(INSTALL) diff --git a/configure/CONFIG_COMMON b/configure/CONFIG_COMMON index 43f4866d7..471226db5 100644 --- a/configure/CONFIG_COMMON +++ b/configure/CONFIG_COMMON @@ -80,9 +80,9 @@ COMMON_DIR = ../O.Common IOCS_APPL_TOP = $(shell $(FULLPATHNAME) $(INSTALL_LOCATION)) #------------------------------------------------------- -# Make echo output - suppress echoing if make's '-s' flag is set +# Make echo output - suppress echoing if '-s' flag was given NOP = : -ECHO = @$(if $(findstring s,$(MFLAGS)),$(NOP),echo) +ECHO = @$(if $(filter -s,$(MFLAGS)),$(NOP),echo) #------------------------------------------------------- ifdef T_A diff --git a/configure/os/CONFIG.Common.RTEMS b/configure/os/CONFIG.Common.RTEMS index 8f65b08f7..03f07231d 100644 --- a/configure/os/CONFIG.Common.RTEMS +++ b/configure/os/CONFIG.Common.RTEMS @@ -72,7 +72,7 @@ CPPFLAGS += $($(BUILD_CLASS)_CPPFLAGS) $(POSIX_CPPFLAGS) $(OPT_CPPFLAGS)\ $(USR_CPPFLAGS) $(CMD_CPPFLAGS) $(ARCH_DEP_CPPFLAGS) $(OP_SYS_CPPFLAGS)\ $(OP_SYS_INCLUDE_CPPFLAGS) $(CODE_CPPFLAGS) -ECHO = @$(if $(findstring s,$(MFLAGS)),$(NOP),echo) +ECHO = @$(if $(filter -s,$(MFLAGS)),$(NOP),echo) #-------------------------------------------------- # Although RTEMS uses gcc, it wants to use gcc its own way From dd9f38d7112d21b010ac6334b230e113b1338e1d Mon Sep 17 00:00:00 2001 From: Ralph Lange Date: Tue, 26 Jan 2021 17:14:00 +0100 Subject: [PATCH 2/2] Build: Fix spurious failures with SNIPPETS in Windows Under some combinations of shell / Make version / Windows version, Windows make was giving up searching for a target "../" --- configure/RULES_EXPAND | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/configure/RULES_EXPAND b/configure/RULES_EXPAND index 51657ebd8..f61666bb7 100644 --- a/configure/RULES_EXPAND +++ b/configure/RULES_EXPAND @@ -33,8 +33,10 @@ expand_clean: ASSEMBLE_TOOL ?= $(PERL) $(TOOLS)/assembleSnippets.pl define COMMON_ASSEMBLY_template +ifneq '$$($1_PATTERN)' '' $1_SNIPPETS += $$(foreach dir, .. $$(SRC_DIRS), \ $$(wildcard $$(dir)/$$($1_PATTERN))) +endif $(COMMON_DIR)/$1: $$($1_SNIPPETS) $(ECHO) "Assembling common file $$@ from snippets" @$(RM) $1 @@ -45,8 +47,10 @@ $(foreach asy, $(COMMON_ASSEMBLIES), \ $(eval $(call COMMON_ASSEMBLY_template,$(strip $(asy))))) define ASSEMBLY_template +ifneq '$$($1_PATTERN)' '' $1_SNIPPETS += $$(foreach dir, .. $$(SRC_DIRS), \ $$(wildcard $$(dir)/$$($1_PATTERN))) +endif $1: $$($1_SNIPPETS) $(ECHO) "Assembling file $$@ from snippets" @$(RM) $$@