# Top level makefile for INETSVCS 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 make stop due to build errors.
.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/INETSVCS/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+ INETSVCS-BOOT+ INETSVCS-DTC+ INETSVCS-INC+ \
	INETSVCS-INETD+ INETSVCS-RUN+ InternetSrvcs/prod_info+ \
	InternetSvcSec/prod_info+ INETSVCS-SEC+ MAILERS+ \
	MailUtilities/prod_info+ util+ kutil+ libtelnet+ bind+ bootp+ \
	dpp+ elm+ fingerd+ from+ ftp+ ftpd+ gated3.0/src+ \
	gated3.0/dev_kit/emanate/sub/ospf+ headers+ include+  inetd+ \
	mail+ mailx+ netconfig.link+ ocd+ pathalias+ prmail+ rbootd+ rcp+ \
	rdist+ remsh+ remshd+ rlogin+ rlogind+ ruptime+ rwho+ rwhod+ \
	scripts+ sendmail+ telnet+ telnetd+ tftp+ tftpd+ xntp+ vacation+ \
	whois+ mrouted+ talk+ talkd+ dhcpclient+

# ****************** 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.
# (RBOOTD.all depends on RBOOTD.clean, RBOOTD.build, and RBOOTD.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
