#!/bin/make -f
# @(#)man/Makefile	1.5 9/6/92 04:39:31
# Makefile for the smail man directories
#
#    Copyright (C) 1987, 1988 Ronald S. Karr and Landon Curt Noll
#    Copyright (C) 1992  Ronald S. Karr
# 
# See the file COPYING, distributed with smail, for restriction
# and warranty information.

SHELL=/bin/sh
MAKE=make
GET=sccs get
AR=ar
LINT=lint
CLEAN=sccs clean
MK=${MAKE} -${MAKEFLAGS} SHELL=${SHELL}
SRC_PREFIX=

ROOT=../..
MANS=man1 man5 man8
MISC=Makefile
SRC=${MISC}

all:
	@for i in ${MANS}; do \
		echo "Build targets under ${SRC_PREFIX}$$i ..."; \
		(cd $$i; ${MK} SRC_PREFIX=${SRC_PREFIX}$$i/); \
	 done	# $(MAKE)

sources: ${SRC}
	@for i in ${MANS}; do \
		echo "Get sources under ${SRC_PREFIX}$$i ..."; \
		(cd $$i; ${MK} SRC_PREFIX=${SRC_PREFIX}$$i/ sources); \
	 done	# $(MAKE)

${SRC}:
	${GET} $@

names:
	@for i in ${SRC}; do echo ${SRC_PREFIX}$$i; done
	@for i in ${MANS}; do \
		(cd $$i; ${MK} SRC_PREFIX=${SRC_PREFIX}$$i/ names); \
	 done	# $(MAKE)

depend:
	@for i in ${MANS}; do \
		echo "Make dependencies under ${SRC_PREFIX}$$i ..."; \
		(cd $$i; ${MK} SRC_PREFIX=${SRC_PREFIX}$$i/ depend); \
	 done	# $(MAKE)

install:
	@for i in ${MANS}; do \
		echo "Install targets under ${SRC_PREFIX}$$i ..."; \
		(cd $$i; ${MK} SRC_PREFIX=${SRC_PREFIX}$$i/ install); \
	 done	# $(MAKE)

installman:
	@for i in ${MANS}; do \
		echo "Install man pages under ${SRC_PREFIX}$$i ..."; \
		(cd $$i; ${MK} SRC_PREFIX=${SRC_PREFIX}$$i/ installman); \
	 done	# $(MAKE)

clean:
	@for i in ${MANS}; do \
		echo "Clean under ${SRC_PREFIX}$$i ..."; \
		(cd $$i; ${MK} SRC_PREFIX=${SRC_PREFIX}$$i/ clean); \
	 done	# $(MAKE)

clobber:
	@for i in ${MANS}; do \
		echo "Clobber under ${SRC_PREFIX}$$i ..."; \
		(cd $$i; ${MK} SRC_PREFIX=${SRC_PREFIX}$$i/ clobber); \
	 done	# $(MAKE)

nuke:
	-${CLEAN}
	-${GET} Makefile
	@for i in ${MANS}; do \
		echo "Nuke under ${SRC_PREFIX}$$i ..."; \
		(cd $$i; ${MK} SRC_PREFIX=${SRC_PREFIX}$$i/ nuke); \
	 done	# $(MAKE)
