diff --git a/configure/RULES_BUILD b/configure/RULES_BUILD index 655ff0712..9c3e8ddb3 100644 --- a/configure/RULES_BUILD +++ b/configure/RULES_BUILD @@ -96,32 +96,6 @@ LIBTARGETS += $(LIBNAME) $(INSTALL_LIBS) \ $(INSTALL_LIBS): $(INSTALL_SHRLIBS) $(INSTALL_DLL_LINK_LIBS) $(INSTALL_LOADABLE_SHRLIBS) -#--------------------------------------------------------------- -# Include created RULES* files from current top -# -# NOTE: A Makefile which installs cfg RULES* files -# cannot use defs or rules from those installed cfg files -# -RULES_TOP:=$(INSTALL_LOCATION) -ifneq ($(CONFIG),$(TOP)/configure) --include $(TOP)/configure/RULES_BUILD -endif -ifneq ($(wildcard $(RULES_TOP)/cfg/RULES*),) --include $(wildcard $(RULES_TOP)/cfg/RULES*) -endif - -# Include RULES* files from tops defined in RELEASE* files -ifneq ($(RELEASE_TOPS),) -define TOP_RULES_template - RULES_TOP:=$$($(1)) - -include $$(if $(patsubst $$($(1))/configure,,$$(CONFIG)),\ - $$(strip $$($(1)))/configure/RULES_BUILD, \ - nonexistantFilename) - -include $$(wildcard $$($(1))/cfg/RULES*) nonexistantFilename -endef -$(foreach top, $(RELEASE_TOPS), $(eval $(call TOP_RULES_template,$(top)) )) -endif -#--------------------------------------------------------------- -include $(CONFIG)/RULES_FILE_TYPE diff --git a/configure/RULES_FILE_TYPE b/configure/RULES_FILE_TYPE index 2748f3b11..1831c0213 100644 --- a/configure/RULES_FILE_TYPE +++ b/configure/RULES_FILE_TYPE @@ -12,63 +12,101 @@ # # -------------------------------------------------------------- -# Module developer can now define a new type of file, e.g. ABC, -# so that files of type ABC will be installed into an abc sub- -# directory within $(INSTALL_LOCATION) by creating a new file or -# adding three definitions to /configure/RULES_FILE_TYPE +# Module developers can now define a new type of file, e.g. ABC, +# so that files of type ABC will be installed into a directory +# defined by INSTALL_ABC. This is done by creating a new RULES_ABC +# file with the following lines: # # FILE_TYPE += ABC # INSTALL_ABC = $(INSTALL_LOCATION)/abc -# DIRECTORY_TARGETS += $(INSTALL_ABC) # -# plus any rules necessary to create files of type ABC. +# (optional rules necessary for files of type ABC) # -# The modlule developer installs this new RULES_ file -# into the module's $(INSTALL_LOCATION)/cfg by including the -# following line in the src Makefile: -# CFGS += RULES_ABC +# The INSTALL_ABC directory should be be a subdirectory of +# $(INSTALL_LOCATION). The file type ABC should be target +# architecture independent (alh files, medm files, edm files). +# +# The module developer installs this new RULES file into the +# directory $(INSTALL_LOCATION)/cfg by including the +# following Makefile line: +# +# CFG += RULES_ABC # -# Support or ioc modules using the developer's module will -# be able to create and install type ABC files of their own. -# using the following Makefile definition: +# Files of type ABC are installed into INSTALL_ABC directory +# by adding a line like the following to a Makefile. # -# ABCS += +# ABC += # +# Files in $(INSTALL_LOCATION)/cfg directory are now included by +# the base config files so the definitions and rules are available +# for use by other src directory Makefiles in the same module or +# by other modules with a RELEASE line pointing to the TOP of +# the module with RULES_ABC. +FILE_TYPE += ADL +INSTALL_ADL = $(INSTALL_LOCATION)/adl + +FILE_TYPE += ALH +INSTALL_ALH = $(INSTALL_LOCATION)/alh + +FILE_TYPE += CFG +INSTALL_CFG = $(INSTALL_LOCATION)/cfg + +FILE_TYPE += EDL +INSTALL_EDL = $(INSTALL_LOCATION)/edl + +FILE_TYPE += IDL +INSTALL_IDL = $(INSTALL_LOCATION_LIB)/idl + +FILE_TYPE += PERL_MODULES +INSTALL_PERL_MODULES = $(INSTALL_LOCATION_LIB)/perl + +SCRIPTS_HOST += $(PERL_SCRIPTS) +# PERL_SCRIPTS are installed into existing $(INSTALL_BIN) for Host systems + +ifdef T_A +#--------------------------------------------------------------- +# Include RULES* files from tops defined in RELEASE* files +ifneq ($(RELEASE_TOPS),) +define TOP_RULES_template + RULES_TOP:=$$($(1)) + -include $$(if $(patsubst $$($(1))/configure,,$$(CONFIG)),\ + $$(strip $$($(1)))/configure/RULES_BUILD, \ + nonexistantFilename) + -include $$(wildcard $$($(1))/cfg/RULES*) nonexistantFilename +endef +$(foreach top, $(RELEASE_TOPS), $(eval $(call TOP_RULES_template,$(top)) )) +endif + +#--------------------------------------------------------------- +# Include created RULES* files from current top +# +RULES_TOP:=$(INSTALL_LOCATION) +ifneq ($(CONFIG),$(TOP)/configure) +-include $(TOP)/configure/RULES_BUILD +endif + +RULES_TOP_FILES= $(wildcard $(RULES_TOP)/cfg/RULES*) +ifeq ($(findstring Host,$(VALID_BUILDS)),Host) +ifneq ($(CFG),) +INSTALLS_CFG = $(CFG:%=$(INSTALL_CFG)/%) +RULES_TOP_FILES+= $(INSTALLS_CFG) +endif +ifneq ($(RULES_TOP_FILES),) +include $(sort $(RULES_TOP_FILES)) +endif +else + include $(RULES_TOP_FILES) +endif +#--------------------------------------------------------------- ifeq ($(findstring Host,$(VALID_BUILDS)),Host) -FILE_TYPE += ADL -INSTALL_ADL = $(INSTALL_LOCATION)/adl -DIRECTORY_TARGETS += $(INSTALL_ADL) - -FILE_TYPE += ALH -INSTALL_ALH = $(INSTALL_LOCATION)/alh -DIRECTORY_TARGETS += $(INSTALL_ALH) - -FILE_TYPE += CFG -INSTALL_CFG = $(INSTALL_LOCATION)/cfg -DIRECTORY_TARGETS += $(INSTALL_CFG) - -FILE_TYPE += IDL -INSTALL_IDL = $(INSTALL_LOCATION_LIB)/idl -DIRECTORY_TARGETS += $(INSTALL_IDL) - -FILE_TYPE += PERL_MODULE -INSTALL_PERL_MODULE = $(INSTALL_LOCATION_LIB)/perl -DIRECTORY_TARGETS += $(INSTALL_PERL_MODULE) - -SCRIPTS += $(PERL_SCRIPTS) -# PERL_SCRIPTS are installed into existing $(INSTALL_LOCATION_BIN) - -#--------------------------------------------------------------- -ifdef T_A - define FILE_TYPE_template -$(1)S += $$(if $$(strip $$($(1)S_$$(ARCH_CLASS))),$$(subst -nil-,,$$($(1)S_$$(ARCH_CLASS))), $$($(1)S_DEFAULT)) +$(1) += $$(if $$(strip $$($(1)_$$(ARCH_CLASS))),$$(subst -nil-,,$$($(1)_$$(ARCH_CLASS))), $$($(1)_DEFAULT)) -INSTALLS_$(1) = $$($(1)S:%=$$(INSTALL_$(1))/%) +INSTALLS_$(1) = $$($(1):%=$$(INSTALL_$(1))/%) buildInstall : $$(INSTALLS_$(1)) $$(INSTALL_$(1))/%: % @@ -85,9 +123,13 @@ clean:: endef $(foreach type, $(FILE_TYPE),$(eval $(call FILE_TYPE_template,$(strip $(type))))) - - endif + #--------------------------------------------------------------- - endif + +define FILE_TYPE_template2 +DIRECTORY_TARGETS += $$(INSTALL_$(1)) +endef +$(foreach type, $(FILE_TYPE),$(eval $(call FILE_TYPE_template2,$(strip $(type))))) +