# Top level makefile for NFS product.
#
# Possible targets are:
#       make all        - default: clean, build, and install all filesets
#       make clean      - removes all objects and executables
#       make build      - compiles and creates executables
#       make install    - puts deliverables in target directory
#
# This will prevent premature build stops when build errors occur.
.IGNORE:

# Things you might want to change.  Pass them in on the command line:
# ROOT - should point to the root where the commands will be installed
#        (e.g. /DELIVER/NFS/indnetwk)

ROOT=

MKFLAGS=ROOT=${ROOT}

MAKE=/usr/ccs/bin/make ${MKFLAGS}

# List of directories.
# NOTE that the directory name MUST be followed by a period.  This is so the
# makefile can later on use macro string substitution (:subst1=subst2) to
# change the period to .all, .clean, .build, or .install.

DIRECTORIES = DEL-INFO+ NFS-CLIENT+ NFS-CORE+ NFS-PRG+ NFS-SERVER+ \
	NIS-CLIENT+ NIS-SERVER+ cmds/usr.lib+ cmds/usr.etc/ypserv+ \
	cmds/usr.etc/yp+ cmds/usr.etc/vhe+ cmds/usr.etc/rpc.statd+ \
	cmds/usr.etc/rpc.pcnfsd+ cmds/usr.etc/rpc.lockd+ cmds/usr.etc/rexd+ \
	cmds/usr.etc/keyserv+ cmds/usr.etc/automount+ cmds/usr.etc+ \
	cmds/usr.bin+ cmds/ucb+ cmds/etc+ cmds/bin+ include+ scripts+

# ****************** Start of targets *****************

default: all

all: clean build install

clean: ${DIRECTORIES:+=.clean}

build: ${DIRECTORIES:+=.build}

install: ${DIRECTORIES:+=.install}

# *********************** rules for the directories *************

# The $$@ macro evaluates to the target, for a dependancy.
# (NFS-CORE.all depends on NFS-CORE.clean, NFS-CORE.build, and NFS-CORE.install)

$(DIRECTORIES:+=.all) $$(@:.all=.clean) $$(@:.all=.build) $$(@:.all=.install)

$(DIRECTORIES:+=.clean):
	@cd $(@:.clean=); ${MAKE} clean

$(DIRECTORIES:+=.build):
	@cd $(@:.build=); ${MAKE} build

$(DIRECTORIES:+=.install):
	@cd $(@:.install=); ${MAKE} install
