diff --git a/configure/CONFIG b/configure/CONFIG index 4f20c7d52..637afa3b4 100644 --- a/configure/CONFIG +++ b/configure/CONFIG @@ -58,6 +58,10 @@ include $(CONFIG)/CONFIG_BASE_VERSION include $(CONFIG)/os/CONFIG.$(EPICS_HOST_ARCH).Common -include $(CONFIG)/os/CONFIG_SITE.$(EPICS_HOST_ARCH).Common +RELEASE_TOPS := $(shell $(CONVERTRELEASE) -T $(TOP) releaseTops) +RELEASE_TOPS_REVERSE := $(shell \ + $(PERL) -e '$$,=" ";print reverse @ARGV' $(RELEASE_TOPS)) + ifdef T_A # Cross compile specific definitions @@ -88,8 +92,8 @@ endif # Include /cfg/CONFIG* definitions from tops defined in RELEASE* files # ifneq ($(CONFIG),$(TOP)/configure) -RELEASE_TOPS := $(shell $(CONVERTRELEASE) -T $(TOP) releaseTops) -RELEASE_CFG_CONFIGS = $(foreach top, $(RELEASE_TOPS), $(wildcard $($(top))/cfg/CONFIG*)) +RELEASE_CFG_CONFIGS = $(foreach top, $(RELEASE_TOPS_REVERSE), \ + $(wildcard $($(top))/cfg/CONFIG*)) ifneq ($(RELEASE_CFG_CONFIGS),) include $(RELEASE_CFG_CONFIGS) endif diff --git a/configure/CONFIG_APP_INCLUDE b/configure/CONFIG_APP_INCLUDE index 14113c951..9c23ec6a4 100644 --- a/configure/CONFIG_APP_INCLUDE +++ b/configure/CONFIG_APP_INCLUDE @@ -1,7 +1,4 @@ export TOP -export IOCAPPS - -RELEASE_TOPS := $(shell $(CONVERTRELEASE) -T $(TOP) releaseTops) ifneq ($(RELEASE_TOPS),) diff --git a/configure/RULES_ARCHS b/configure/RULES_ARCHS index 1d4c2d4c1..6dfe4c92e 100644 --- a/configure/RULES_ARCHS +++ b/configure/RULES_ARCHS @@ -30,6 +30,15 @@ cleanArchTargets = $(foreach arch,$(BUILD_ARCHS), clean$(DIVIDER)$(arch)) buildDirs = $(addprefix O.,$(BUILD_ARCHS)) +# Include /cfg/DIR_RULES* files from tops defined in RELEASE* files +# Do this here so they can add ACTIONS +# +RELEASE_CFG_DIR_RULES = $(foreach top, $(RELEASE_TOPS), \ + $(wildcard $($(top))/cfg/DIR_RULES*)) +ifneq ($(RELEASE_CFG_DIR_RULES),) + include $(RELEASE_CFG_DIR_RULES) +endif + #************************************************************************* # Create epics_host_arch dependancies for GNU make -j option # Only works with GNU make 3.81 or later (uses eval function) @@ -92,3 +101,7 @@ realclean :: .PHONY : $(cleanArchTargets) .PHONY : $(BUILD_ARCHS) rebuild .PHONY : $(ACTIONS) clean realclean archclean all + +# User specific rules +# +-include $(HOME)/configure/RULES_USER diff --git a/configure/RULES_DIRS b/configure/RULES_DIRS index 8fd3f63b6..1043fc140 100644 --- a/configure/RULES_DIRS +++ b/configure/RULES_DIRS @@ -36,6 +36,15 @@ actionArchTargets = $(foreach action, $(ACTIONS),\ all : install +# Include /cfg/DIR_RULES* files from tops defined in RELEASE* files +# Do this here so they can add ACTIONS +# +RELEASE_CFG_DIR_RULES = $(foreach top, $(RELEASE_TOPS), \ + $(wildcard $($(top))/cfg/DIR_RULES*)) +ifneq ($(RELEASE_CFG_DIR_RULES),) + include $(RELEASE_CFG_DIR_RULES) +endif + # Allows rebuild to work with parallel builds option, -j. ifeq (rebuild,$(filter rebuild,$(MAKECMDGOALS))) $(foreach dir, $(DIRS), $(dir)$(DIVIDER)install): \ @@ -79,3 +88,7 @@ $(ARCHS) $(ACTIONS) $(actionArchTargets) :%: \ .PHONY : $(dirActionArchTargets) .PHONY : $(actionArchTargets) + +# User specific rules +# +-include $(HOME)/configure/RULES_USER diff --git a/configure/RULES_FILE_TYPE b/configure/RULES_FILE_TYPE index b58bf550f..c3a3e541c 100644 --- a/configure/RULES_FILE_TYPE +++ b/configure/RULES_FILE_TYPE @@ -10,23 +10,25 @@ # #--------------------------------------------------------------- -# Include /configure/RULES_BUILD definitions from tops defined in RELEASE* files +# Include /configure/RULES_BUILD from tops defined in RELEASE* files # -RELEASE_RULES_BUILDS = $(foreach top, $(RELEASE_TOPS), $(wildcard $($(top))/configure/RULES_BUILD)) +RELEASE_RULES_BUILDS = $(foreach top, $(RELEASE_TOPS), \ + $(wildcard $($(top))/configure/RULES_BUILD)) ifneq ($(RELEASE_RULES_BUILDS),) include $(RELEASE_RULES_BUILDS) endif #--------------------------------------------------------------- -# Include /cfg/RULES* definitions from tops defined in RELEASE* files +# Include /cfg/RULES* files from tops defined in RELEASE* files # -RELEASE_CFG_RULES = $(foreach top, $(RELEASE_TOPS), $(wildcard $($(top))/cfg/RULES*)) +RELEASE_CFG_RULES = $(foreach top, $(RELEASE_TOPS), \ + $(wildcard $($(top))/cfg/RULES*)) ifneq ($(RELEASE_CFG_RULES),) include $(RELEASE_CFG_RULES) endif #--------------------------------------------------------------- -# If this is not BASE then include TOP/configure/RULES_BUILD definitions +# If this is not BASE then include /configure/RULES_BUILD # ifeq ($(wildcard $(TOP)/configure/CONFIG_BASE_VERSION),) TOP_RULES_BUILDS = $(wildcard $(TOP)/configure/RULES_BUILD) @@ -36,7 +38,7 @@ endif endif #--------------------------------------------- -# Include our own $(INSTALL_CFG)/RULES* definitions +# Include our own $(INSTALL_CFG)/RULES* files # TOP_CFG_RULES = $(wildcard $(INSTALL_CFG)/RULES*) ifneq ($(TOP_CFG_RULES),) @@ -69,3 +71,6 @@ $(foreach type, $(FILE_TYPE),$(eval $(call FILE_TYPE_template,$(strip $(type)))) clean:: @$(RM) $(foreach type, $(FILE_TYPE), $($(type))) +# User specific rules +# +-include $(HOME)/configure/RULES_USER diff --git a/configure/RULES_TOP b/configure/RULES_TOP index 8f100621a..94d753ec1 100644 --- a/configure/RULES_TOP +++ b/configure/RULES_TOP @@ -82,3 +82,10 @@ help: .PHONY: cleandirs distclean cvsclean realuninstall archuninstall uninstallDirs .PHONY: uninstall help +# Include /cfg/TOP_RULES* files from tops defined in RELEASE* files +# +RELEASE_CFG_TOP_RULES = $(foreach top, $(RELEASE_TOPS), \ + $(wildcard $($(top))/cfg/TOP_RULES*)) +ifneq ($(RELEASE_CFG_TOP_RULES),) + include $(RELEASE_CFG_TOP_RULES) +endif diff --git a/documentation/RELEASE_NOTES.html b/documentation/RELEASE_NOTES.html index 98cd64ae7..6bbcb5643 100644 --- a/documentation/RELEASE_NOTES.html +++ b/documentation/RELEASE_NOTES.html @@ -13,6 +13,31 @@ +

Changes to <top>/cfg/* files

+ +

The order in which cfg/CONFIG* and cfg/RULES* files are included from support +applications listed in the configure/RELEASE* files has been changed. Previously +these files were included in the order in which the top areas are listed in the +RELEASE file, but it makes more sense to load them in reverse order since later +entries override earlier ones in Makefiles but the release file order is +supposed to allow earlier entries to take precedence over later ones. The same +change has been made to the inclusion of the <top>/configure/RULES_BUILD +files.

+ +

Two new file types can also be provided in a module's cfg directory. Files +named TOP_RULES* will be included by the top-level Makefile of other modules +that refer to this module; files name DIR_RULES* will be included by all +Makefiles that merely descend into lower-level directories. The cfg/RULES* files +are only included when make is building code inside the O.<arch> +directories.

+ +

The new cfg/DIR_RULES* file inclusion was designed to permit new recursive +make actions to be implemented by appending the name of the new action to the +ACTIONS variable. There must be a matching rule in one of the cfg/RULES* files +when doing this. Similar rules may also be defined in the cfg/TOP_RULES* and/or +cfg/DIR_RULES* files, but these should only state prerequisites and not directly +provide commands to be executed.

+

MinGW Cross-builds from Linux

Build configuration files have been back-ported from the 3.15 branch that