# # $Id$ # all:: inc install $(DIRS) :: $(MAKE) -C $@ DO_X += inc DO_X += install DO_X += build dirPart = $(word 1, $(subst $(DIVIDER), ,$@)) actionPart = $(word 2, $(subst $(DIVIDER), ,$@)) buildPart = $(word 3, $(subst $(DIVIDER), ,$@)) hostDirTargets = $(foreach x, $(DO_X),\ $(foreach dir, $(DIRS), $(dir)$(DIVIDER)$(x)$(DIVIDER)host)) crossDirTargets += $(foreach x, $(DO_X),\ $(foreach dir, $(DIRS), $(dir)$(DIVIDER)$(x)$(DIVIDER)cross)) host :: $(hostDirTargets) cross :: $(crossDirTargets) $(hostDirTargets) $(crossDirTargets) :: $(MAKE) -C $(dirPart) $(actionPart)$(DIVIDER)$(buildPart) fakeHost = $(foreach dir, $(DIRS), $(dir)$(DIVIDER)$(DIVIDER)host) fakeCross = $(foreach dir, $(DIRS), $(dir)$(DIVIDER)$(DIVIDER)cross) inc:: inc$(DIVIDER)host inc$(DIVIDER)cross inc$(DIVIDER)host :: $(subst ,inc,$(fakeHost)) inc$(DIVIDER)cross :: $(subst ,inc,$(fakeCross)) install :: install$(DIVIDER)host install$(DIVIDER)cross install$(DIVIDER)host :: $(subst ,install,$(fakeHost)) install$(DIVIDER)cross :: $(subst ,install,$(fakeCross)) build :: build$(DIVIDER)host build$(DIVIDER)cross build$(DIVIDER)host :: $(subst ,build,$(fakeHost)) build$(DIVIDER)cross :: $(subst ,build,$(fakeCross)) clean :: $(addsuffix $(DIVIDER)clean, $(DIRS)) # # @echo "TOP: Cleaning # @for DIR in ${DIRS}; do \ # find $$DIR/src -type d -name "O.*" -prune -exec rm -rf {} \; ; \ # done # %$(DIVIDER)clean : $(MAKE) -C $* clean depends :: $(foreach dir, $(DIRS), $(dir)$(DIVIDER)depends) %$(DIVIDER)depends : $(MAKE) -C $* depends uninstall:: $(addprefix uninstall$(DIVIDER), $(BUILDARCHS)) uninstall$(DIVIDER)%:: @echo "TOP: Uninstalling $* " @rm -rf ./bin/$* ./lib/$* dbd include man @rm -rf rec.bak rec tar: @echo "TOP: Creating $(DIRNAME).Tar file..." @ls Makefile* | xargs tar vcf ${DIRNAME}.Tar @if [ -f .current_rel_hist ]; then \ ls .current_rel_hist | xargs tar vrf ${DIRNAME}.Tar ; \ fi @if [ -f EPICS_BASE ]; then \ ls EPICS_BASE | xargs tar vrf ${DIRNAME}.Tar ; \ fi @for DIR in ${DIRS}; do \ find $${DIR} -name CVS -prune -o ! -type d -print \ | grep -v "/O\..*$$" | xargs tar vrf ${DIRNAME}.Tar; \ done .PHONY : $(DIRS) .PHONY : host cross .PHONY : $(hostDirTargets) $(crossDirTargets) .PHONY : $(DO_X) .PHONY : all clean depends .PHONY : uninstall .PHONY : tar