#RULES.Db SUBTOOL = $(EPICS_BASE_BIN)/subtool PREFIX=$(shell echo $* | sed -e 's-[0-9]--g' | sed -e 's-\.db--g') ARCHS += $(BUILD_ARCHS) host cross ACTIONS += clean inc depends buildInstall build actionArchTargets = $(foreach action, $(ACTIONS) install,\ $(foreach arch, $(ARCHS), \ $(action)$(DIVIDER)$(arch))) all install :: inc buildInstall buildInstall: .DEPENDS dbd $(DBFROMTEMPLATE) $(INDDBFROMTEMPLATE) $(PROD) inc build depends: $(TOP)/dbd: $(MKDIR) $(TOP)/dbd dbd: $(TOP)/dbd ifndef WIN32 ln -s $(TOP)/dbd dbd endif $(DBFROMTEMPLATE):%.db: %.template %.substitutions $(RM) $@ $(SUBTOOL) $*.template $*.substitutions > $@ $(INDDBFROMTEMPLATE):%.db: %.substitutions $(RM) $@ ifndef WIN32 $(SUBTOOL) $(PREFIX).template $*.substitutions > $@ endif .DEPENDS: Makefile @$(RM) $@ ifndef WIN32 @for NAME in $(INDDBFROMTEMPLATE) garbage_marty ; do \ if [ $$NAME != garbage_marty ] ; then \ PREFIX="`echo $$NAME | sed -e 's-[0-9]--g' | sed -e 's-\.db--g'`";\ echo "$$NAME: $$PREFIX.template" >> $@;\ fi ; \ done endif clean:: @$(RM) dbd $(DBFROMTEMPLATE) $(INDDBFROMTEMPLATE) .DEPENDS $(PROD) $(actionArchTargets) :%: $(MAKE) $(word 1, $(subst $(DIVIDER), ,$@)) $(ARCHS):%: install .PHONY :: $(ARCHS) $(ACTIONS) .PHONY :: $(actionArchTargets) -include .DEPENDS