From 70a87d2c95047e9b6348e3a073ee3e11f84e7f99 Mon Sep 17 00:00:00 2001 From: "Janet B. Anderson" Date: Wed, 7 Aug 1996 20:46:45 +0000 Subject: [PATCH] Now includes RULES_DIRS, added rules for applications --- config/RULES_TOP | 109 ++++++++++++++++------------------------------- 1 file changed, 36 insertions(+), 73 deletions(-) diff --git a/config/RULES_TOP b/config/RULES_TOP index 2c1f91460..d5f804d50 100644 --- a/config/RULES_TOP +++ b/config/RULES_TOP @@ -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)$(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 $(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/ (default rule)" + @echo " build - Builds objects, using libraries from "build_libs" + @echo " clean - Cleans objects. Clean removes the" O. dirs + @echo " in all except the O. level Makefile" + @echo " depends - Generates include dependencies" + @echo "\"Partial\" build targets supported by Makefiles:" + @echo " install. - Builds and installs only. + @echo " clean. - Cleans binaries in O. dirs only." + @echo " build. - Builds only. + @echo " depends. - Generates 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. 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))