#
# $Id: Makefile,v 5.1.1.2 90/01/11 16:46:02 jsp Exp Locker: jsp $
#
# Copyright (c) 1989 Jan-Simon Pendry
# Copyright (c) 1989 Imperial College of Science, Technology & Medicine
# Copyright (c) 1989 The Regents of the University of California.
# All rights reserved.
#
# This code is derived from software contributed to Berkeley by
# Jan-Simon Pendry at Imperial College, London.
#
# Redistribution and use in source and binary forms are permitted
# provided that the above copyright notice and this paragraph are
# duplicated in all such forms and that any documentation,
# advertising materials, and other materials related to such
# distribution and use acknowledge that the software was developed
# by Imperial College of Science, Technology and Medicine, London, UK.
# The names of the College and University may not be used to endorse
# or promote products derived from this software without specific
# prior written permission.
# THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
# IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
#
#	%W% (Berkeley) %G%
#

# -------- Users may care to over ride these values --------
VER = ${REL}
SHELL = /bin/sh

# Machine architecture
ARCH = `PATH=$${PATH}:. sh arch`

# O/S Name
OS = `PATH=$${PATH}:. sh os-type`

# version of make
MAKE = make
MKCOM = Makefile.com
MKARGS = -f ${MKCOM}

# -------- Users should leave the rest alone! --------

OS_SUPPORTED = acis43 aix2 aux bsd44 concentrix hlh42 hpux riscix sos3 sos4 u2_2 u3_0 umax43 utx32 xinu43
CHECK_OS = \
	case " ${OS_SUPPORTED} " in *" $${OS} "*) ;; \
	*) case "$${OS}" in unknown);; *) echo "Unknown OS '$${OS}'";; esac; \
	   echo "OS should be one of ${OS_SUPPORTED}"; \
	   exit 1;; \
	esac

#
# "all" and "install" work in the architecture specific sub-directory.
# The other make rules work in the source directory.
#

all install clean lint:
	@OS="${OS}" ARCH="${ARCH}" MKARGS="-f ../${MKCOM}"; \
	${CHECK_OS}; \
	case "`echo M?kefile.config`" in \
	Makefile.config) MKARGS="$${MKARGS} -f ../Makefile.config";; \
	esac; \
	case "`echo M?kefile.$${OS}`" in \
	Makefile.$${OS}) MKARGS="$${MKARGS} -f ../Makefile.$${OS}";; \
	esac; \
	case "`echo M?kefile.local`" in \
	Makefile.local) MKARGS="$${MKARGS} -f ../Makefile.local";; \
	esac; \
	case "`echo M?kefile.local.$${OS}`" in \
	Makefile.local.$${OS}) MKARGS="$${MKARGS} -f ../Makefile.local.$${OS}";; \
	esac; \
	case "`echo $${ARCH}?$${OS}`" in $${ARCH}_$${OS});; *) mkdir $${ARCH}_$${OS}; esac; \
	echo cd $${ARCH}_$${OS}; \
	cd $${ARCH}_$${OS}; \
	echo $(MAKE) $${MKARGS} ARCH=$${ARCH} OS=$${OS} $@; \
	$(MAKE) $${MKARGS} ARCH=$${ARCH} OS=$${OS} $@

co diffs release count: FRC
	$(MAKE) ${MKARGS} ${MFLAGS} $@ OS=undef NAME=${NAME} REL=${REL} "VER=${VER}"

pat print tarfile sharfile: FRC
	@$(MAKE) ${MKARGS} ${MFLAGS} $@ OS=undef

FRC:
