91 lines
2.2 KiB
Plaintext
91 lines
2.2 KiB
Plaintext
#
|
|
# $Id$
|
|
#
|
|
# EPICS RULES_ARCH
|
|
# by Matthew Needes and Mike Bordua and Janet Anderson and Jeff Hill
|
|
#
|
|
|
|
all:: install
|
|
|
|
ACTIONS += inc
|
|
ACTIONS += build
|
|
ACTIONS += install
|
|
ACTIONS += buildInstall
|
|
ACTIONS += depends
|
|
ACTIONS += rebuild
|
|
|
|
actionPart = $(word 1, $(subst $(DIVIDER), ,$@))
|
|
archPart = $(word 2, $(subst $(DIVIDER), ,$@))
|
|
|
|
#
|
|
# hostActionArchTargets
|
|
#
|
|
hostArchs = $(HOST_ARCHS)
|
|
hostActionArchTargets = $(foreach x, $(ACTIONS),\
|
|
$(foreach arch,$(hostArchs), $(x)$(DIVIDER)$(arch)))
|
|
ifeq (Makefile.Host, $(wildcard Makefile.Host))
|
|
hostDirs = $(addprefix O.,$(hostArchs))
|
|
$(hostActionArchTargets) : $(hostDirs)
|
|
$(MAKE) -C O.$(archPart) -f ../Makefile.Host TOP=$(TOP)/.. T_A=$(archPart) B_T=.Host $(actionPart)
|
|
$(hostArchs) : % : O.%
|
|
$(MAKE) -C O.$@ -f ../Makefile.Host TOP=$(TOP)/.. T_A=$@ B_T=.Host
|
|
else
|
|
$(hostActionArchTargets) :
|
|
$(hostArchs) :
|
|
endif
|
|
|
|
#
|
|
# iocActionArchTargets
|
|
#
|
|
iocArchs = $(IOC_ARCHS)
|
|
iocActionArchTargets = $(foreach x, $(ACTIONS), \
|
|
$(foreach arch, $(iocArchs), $(x)$(DIVIDER)$(arch)))
|
|
ifeq (Makefile.Ioc, $(wildcard Makefile.Ioc))
|
|
iocDirs = $(addprefix O.,$(iocArchs))
|
|
$(iocActionArchTargets) : $(iocDirs)
|
|
$(MAKE) -C O.$(archPart) -f ../Makefile.Ioc TOP=$(TOP)/.. T_A=$(archPart) B_T=.Ioc $(actionPart)
|
|
$(iocArchs) : % : O.%
|
|
$(MAKE) -C O.$@ -f ../Makefile.Ioc TOP=$(TOP)/.. T_A=$@ B_T=.Ioc
|
|
else
|
|
$(iocActionArchTargets) :
|
|
$(iocArchs) :
|
|
endif
|
|
|
|
$(hostDirs) :
|
|
$(PERL) $(TOOLS)/makeMakefile.pl $@ $(TOP)/.. .Host
|
|
|
|
$(iocDirs) :
|
|
$(PERL) $(TOOLS)/makeMakefile.pl $@ $(TOP)/.. .Ioc
|
|
|
|
#
|
|
# host/ioc action targets
|
|
#
|
|
$(ACTIONS) :: % : %$(DIVIDER)host %$(DIVIDER)ioc
|
|
HostActionTargets = $(foreach x, $(ACTIONS) clean, $(x)$(DIVIDER)host)
|
|
IocActionTargets = $(foreach x, $(ACTIONS) clean, $(x)$(DIVIDER)ioc)
|
|
$(HostActionTargets) : %$(DIVIDER)host : $(addprefix %$(DIVIDER), $(hostArchs))
|
|
$(IocActionTargets) : %$(DIVIDER)ioc : $(addprefix %$(DIVIDER), $(iocArchs))
|
|
|
|
|
|
#
|
|
# arch targets
|
|
#
|
|
host : $(hostArchs)
|
|
ioc : $(iocArchs)
|
|
|
|
#
|
|
# special clean rule
|
|
#
|
|
clean ::
|
|
$(RMDIR) $(hostDirs) $(iocDirs)
|
|
clean$(DIVIDER)% :
|
|
$(RMDIR) O.$*
|
|
|
|
.PHONY :: $(HostActionTargets)
|
|
.PHONY :: $(IocActionTargets)
|
|
.PHONY :: $(iocActionArchTargets)
|
|
.PHONY :: $(hostActionArchTargets)
|
|
.PHONY :: $(hostArchs) $(iocArchs)
|
|
.PHONY :: $(ACTIONS) clean all host ioc
|
|
|