88 lines
2.4 KiB
Plaintext
88 lines
2.4 KiB
Plaintext
#
|
|
# $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)<fake>$(DIVIDER)host)
|
|
fakeCross = $(foreach dir, $(DIRS), $(dir)$(DIVIDER)<fake>$(DIVIDER)cross)
|
|
|
|
inc:: inc$(DIVIDER)host inc$(DIVIDER)cross
|
|
inc$(DIVIDER)host :: $(subst <fake>,inc,$(fakeHost))
|
|
inc$(DIVIDER)cross :: $(subst <fake>,inc,$(fakeCross))
|
|
|
|
install :: install$(DIVIDER)host install$(DIVIDER)cross
|
|
install$(DIVIDER)host :: $(subst <fake>,install,$(fakeHost))
|
|
install$(DIVIDER)cross :: $(subst <fake>,install,$(fakeCross))
|
|
|
|
build :: build$(DIVIDER)host build$(DIVIDER)cross
|
|
build$(DIVIDER)host :: $(subst <fake>,build,$(fakeHost))
|
|
build$(DIVIDER)cross :: $(subst <fake>,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
|
|
|