Now includes RULES_DIRS, added rules for applications

This commit is contained in:
Janet B. Anderson
1996-08-07 20:46:45 +00:00
parent 41b53c1a67
commit 70a87d2c95

View File

@@ -2,86 +2,49 @@
# $Id$
#
all:: inc install
$(DIRS) ::
$(MAKE) -C $@
include $(TOP)/config/RULES_DIRS
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 $(INSTALL_LOCATION_BIN)/$* $(INSTALL_LOCATION_LIB)/$* \
$(INSTALL_LOCATION)/dbd $(INSTALL_MAN) $(INSTALL_INCLUDE)
@rm -rf rec.bak rec
uninstall:: $(addprefix uninstall$(DIVIDER),$(BUILDARCHS))
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 \
@DIRNAME=$(notdir $(shell pwd)); \
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; \
| grep -v "/O\..*$$" | xargs tar vrf $$DIRNAME.Tar; \
done
help:
@echo "Usage: gnumake [options] [target] ..."
@echo "Targets supported by all Makefiles:"
@echo " install - Installs executables in bin/<arch> (default rule)"
@echo " build - Builds objects, using libraries from "build_libs"
@echo " clean - Cleans objects. Clean removes the" O.<arch> dirs
@echo " in all except the O.<arch> level Makefile"
@echo " depends - Generates include dependencies"
@echo "\"Partial\" build targets supported by Makefiles:"
@echo " install.<arch> - Builds and installs <arch> only.
@echo " clean.<arch> - Cleans <arch> binaries in O.<arch> dirs only."
@echo " build.<arch> - Builds <arch> only.
@echo " depends.<arch> - Generates <arch> dependencies only.
@echo "Targets supported by top level Makefile:"
@echo " uninstall - Cleans directories created by the install."
@echo " tar - Create tar file "
@echo "Indiv. object targets are supported by O.<arch> level Makefile .e.g"
@echo " xxxRecord.o
.PHONY : $(DIRS)
.PHONY : host cross
.PHONY : $(hostDirTargets) $(crossDirTargets)
.PHONY : $(DO_X)
.PHONY : all clean depends
.PHONY : uninstall
.PHONY : tar
.PHONY : uninstall tar help
.PHONY : $(addprefix uninstall$(DIVIDER), $(BUILDARCHS))