Moved code from RULES to RULES_ARCHS.

This commit is contained in:
Janet B. Anderson
2000-02-01 16:08:41 +00:00
parent 0dcf44bf5c
commit 48886ee4c8
2 changed files with 24 additions and 109 deletions

View File

@@ -2,51 +2,7 @@
ifndef T_A
all: install
rebuild: clean all
ACTIONS = inc
ACTIONS += build
ACTIONS += install
ACTIONS += buildInstall
ACTIONS += depends
ACTIONS += rebuild
actionPart = $(word 1, $(subst $(DIVIDER), ,$@))
archPart = $(word 2, $(subst $(DIVIDER), ,$@))
actionArchTargets = $(foreach x, $(ACTIONS),\
$(foreach arch,$(BUILD_ARCHS), $(x)$(DIVIDER)$(arch)))
buildDirs = $(addprefix O.,$(BUILD_ARCHS))
$(actionArchTargets) : $(buildDirs)
$(MAKE) -C O.$(archPart) -f ../Makefile TOP=$(TOP)/.. T_A=$(archPart) $(actionPart)
$(BUILD_ARCHS) : % : O.%
$(MAKE) -C O.$@ -f ../Makefile TOP=$(TOP)/.. T_A=$@
$(ACTIONS):%: $(foreach arch, $(BUILD_ARCHS), %$(DIVIDER)$(arch))
$(buildDirs) :
$(PERL) $(TOOLS)/makeMakefile.pl $@ $(TOP)/..
#
# special clean rule
#
clean ::
$(RMDIR) $(addsuffix *,$(addprefix O.,$(BUILD_ARCHS)))
clean$(DIVIDER)% ::
$(RMDIR) O.$**
.PHONY : $(buildActionTargets)
.PHONY : $(buildActionArchTargets)
.PHONY : $(buildArchs)
.PHONY : $(ACTIONS) clean all
include $(CONFIG)/RULES_ARCHS
else #T_A

View File

@@ -1,90 +1,49 @@
#
# $Id$
#
# EPICS RULES_ARCH
# by Matthew Needes and Mike Bordua and Janet Anderson and Jeff Hill
#
all:: install
all: install
ACTIONS += inc
rebuild: clean all
ACTIONS = inc
ACTIONS += build
ACTIONS += install
ACTIONS += buildInstall
ACTIONS += depends
ACTIONS += rebuild
ACTIONS += browse
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
actionArchTargets = $(foreach x, $(ACTIONS),\
$(foreach arch,$(BUILD_ARCHS), $(x)$(DIVIDER)$(arch)))
#
# 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
buildDirs = $(addprefix O.,$(BUILD_ARCHS))
$(hostDirs) :
$(PERL) $(TOOLS)/makeMakefile.pl $@ $(TOP)/.. .Host
$(actionArchTargets) : $(buildDirs)
$(MAKE) -C O.$(archPart) -f ../Makefile TOP=$(TOP)/.. T_A=$(archPart) $(actionPart)
$(iocDirs) :
$(PERL) $(TOOLS)/makeMakefile.pl $@ $(TOP)/.. .Ioc
$(BUILD_ARCHS) : % : O.%
$(MAKE) -C O.$@ -f ../Makefile TOP=$(TOP)/.. T_A=$@
#
# 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))
$(ACTIONS):%: $(foreach arch, $(BUILD_ARCHS), %$(DIVIDER)$(arch))
#
# arch targets
#
host : $(hostArchs)
ioc : $(iocArchs)
$(buildDirs) :
$(PERL) $(TOOLS)/makeMakefile.pl $@ $(TOP)/..
#
# special clean rule
#
clean ::
$(RMDIR) $(hostDirs) $(iocDirs)
clean$(DIVIDER)% :
$(RMDIR) O.$*
$(RMDIR) $(addsuffix *,$(addprefix O.,$(BUILD_ARCHS)))
.PHONY :: $(HostActionTargets)
.PHONY :: $(IocActionTargets)
.PHONY :: $(iocActionArchTargets)
.PHONY :: $(hostActionArchTargets)
.PHONY :: $(hostArchs) $(iocArchs)
.PHONY :: $(ACTIONS) clean all host ioc
clean$(DIVIDER)% ::
$(RMDIR) O.$**
.PHONY : $(buildActionTargets)
.PHONY : $(buildActionArchTargets)
.PHONY : $(buildArchs)
.PHONY : $(ACTIONS) clean all