[sorry for possible duplicates, forgot to reply to the list]
On 11/09/2017 11:59 PM, Luchini, Kristi L. wrote:
However, my RULES file from R3.14.12, now either generate errors
during the build or it will generate an empty alhConfig which it
installs in to $TOP/alh.
Is there an example of a RULES_<file type> that I can used. Below is
what I am using, which clearly is wrong.
File configure/Makefile
CHECK_RELEASE = YES
TARGETS = $(CONFIG_TARGETS)
CONFIGS += $(subst ../,,$(wildcard $(CONFIG_INSTALLS)))
CFG +=CONFIG_ALARMS RULES_ALARMS
CFG +=CONFIG_PROTOS
include $(TOP)/configure/RULES
File: configure/CONFIG_ALARMS
FILE_TYPE+=ALHS
INSTALL_ALHS = $(INSTALL_LOCATION)/alh
This is no longer needed as there are now a similar definitions in base,
which use ALH, not ALHS. You can keep you won FILE_TYPE, though, since
due to the different name there is no conflict.
File: configure/RULES_ALARMS --- similar to R3.14.12 RULES.Db
This is a mistake. RULES.Db is an overly complicated monster. I wish
there was a way to completely disable it.
All you need is the vpaths:
vpath %.alhConfig $(USR_VPATH) $(GENERIC_SRC_DIRS) $(dir $(ALH))
vpath %.alhsubstitutions $(USR_VPATH) $(GENERIC_SRC_DIRS) $(COMMON_DIR)
however, these are not good. I would rather use
vpath %.alhConfig $(USR_VPATH) $(GENERIC_SRC_DIRS) $(COMMON_DIR)
vpath %.alhsubstitutions $(USR_VPATH) $(GENERIC_SRC_DIRS)
(Presumably alhsubstitutions are sources, while alhConfig may be sources
or produced by the rule below.)
The only rule you need is
$(COMMON_DIR)/%.alhConfig: %.alhsubstitutions
@echo "Inflating alhConfig from $< using local rule"
@$(RM) $@
@echo "$(MSI) -S$< > $(@F) </dev/null"
@$(MSI) -I.. $(ALHFLAGS) -S$< </dev/null > $@
which I would re-write as
$(COMMON_DIR)/%.alhConfig: %.alhsubstitutions
$(ECHO) "Inflating alhConfig from $< using local rule"
$(MSI) -I.. $(ALHFLAGS) -S$< > [email protected]
$(MV) [email protected] $@
(Why suppress echoing of the command line and then echo manually in a
separate command, just so you don't see the $(ALHFLAGS) parameter? The
"output to .tmp, then mv" pattern is to make parallel make more reliable.)
Also, the include of RULES_ALARMS below
File: Makefile:
TOP=../../..
include $(TOP)/configure/CONFIG
ALHS += ntwk_inj.alhConfig
include $(TOP)/configure/RULES
include $(TOP)/configure/RULES_ALARMS
is automatically done by the base rules.
Cheers
Ben