# 
# Mach Operating System
# Copyright (c) 1992-1990 Carnegie Mellon University
# All Rights Reserved.
# 
# Permission to use, copy, modify and distribute this software and its
# documentation is hereby granted, provided that both the copyright
# notice and this permission notice appear in all copies of the
# software, derivative works or modified versions, and any portions
# thereof, and that both notices appear in supporting documentation.
# 
# CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS 
# CONDITION.  CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR
# ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
# 
# Carnegie Mellon requests users of this software to return to
# 
#  Software Distribution Coordinator  or  Software.Distribution@CS.CMU.EDU
#  School of Computer Science
#  Carnegie Mellon University
#  Pittsburgh PA 15213-3890
# 
# any improvements or extensions that they make and grant Carnegie the
# rights to redistribute these changes.
# 
# 
# HISTORY
# $Log:	Makefile,v $
# Revision 2.14  92/04/08  23:26:35  rpd
# 	Added macherr.
# 	[92/04/01            rpd]
# 
# 	Added environment manager.
# 	[92/04/01  18:48:04  rpd]
# 
#	Added cross-compilation support.
# 	[92/03/28            jvh]
# 
# Revision 2.13  92/03/05  22:47:12  rpd
# 	Added bin/ascpp, for luna only.
# 	Changed to not build gdb, w on luna.
# 	[92/03/02            rpd]
# 
# 	Changed to use double-colon rules for top-level targets.
# 	[92/02/28            rpd]
# 
# Revision 2.12  92/02/25  13:18:57  danner
# 	Added bin/swapon.
# 	[92/02/25            danner]
# 
# Revision 2.11  92/02/16  15:43:49  rpd
# 	Changed lib/libcs to lib/libcmucs.
# 	[92/02/16            rpd]
# 
# Revision 2.10  92/02/15  19:34:10  rpd
# 	Added Makefile-subdirs, Makefile-mkdirs.
# 	Added include, lib/libreadline, bin/gdb-3.5.
# 	[92/02/15  17:33:41  rpd]
# 
# Revision 2.9  92/01/27  16:42:01  rpd
# 	Changed recursive make commands to use '+'.
# 	[92/01/27            rpd]
# 
# Revision 2.8  92/01/24  01:30:04  rpd
# 	Added bin/wh.
# 	[92/01/24            rpd]
# 
# 	Changed to use RECURSE_TEMPLATE.
# 	[92/01/23            rpd]
# 
# Revision 2.7  92/01/22  22:51:18  rpd
# 	Revised for new Makefile organization.
# 	[92/01/17            rpd]
# 

include ${MAKETOP}Makefile-common
# more definitions, for recursive makes
include ${MAKETOP}Makefile-subdirs
# more definitions, for mkodirs/mkidirs/mkrdirs
include ${MAKETOP}Makefile-mkdirs

# These subdirectories must exist in the host install/release directories.
# The mkhidirs and mkhrdirs targets will create them.

HXXX = bin contrib etc games include kerberosIV libexec share sys usr.bin \
	usr.sbin 
MKHIDIRS = lib libexec sbin man man/man1 man/man2 man/man3 man/man5 \
	man/man6 man/man8

MKHRDIRS = ${MKHIDIRS}

# These subdirectories must exist in the install/release directories.
# The mkidirs and mkrdirs targets will create them.

MKIDIRS = ${MKHIDIRS} special
MKRDIRS = ${MKIDIRS}

# If we are cross-compiling, then we want to build these directories.

XCOMPILE_DIRS = host_lib host_lib/librpc host_lib/librpc/rpcgen

# We build these subdirectories.
# Order is important: we must do includes and libraries first.

STANDARD_DIRS =
PMAX_DIRS = ${STANDARD_DIRS}
I386_DIRS = ${STANDARD_DIRS}
SUN3_DIRS = ${STANDARD_DIRS}
VAX_DIRS = ${STANDARD_DIRS}
LUNA88K_DIRS = 
TAHOE_DIRS = sbin/enpload

# We only want to do the cross-compilation directories if we are actually
# cross-compiling.  See Makeconf for ${HOST_MACHINE}_hack.

UNDONE_DIRS =  lib/lirpc sbin/XNSrouted sbin/routed 

JUNKED_DIRS = lib/csu.hp300 lib/csu.i386 lib/csu.tahoe lib/csu.vax \
	lib/libg++ sbin/swapon bin/ps sbin/dmesg

LIBC_DIR = lib/libc

DIRS =  ${${HOST_MACHINE}_hack?:${XCOMPILE_DIRS}} \
	lib ${LIBC_DIR} lib/librpc lib/librpc/rpc \
	lib/libcurses lib/libm lib/libresolv \
	lib/libtelnet lib/libterm lib/libutil lib/liby \
	sbin sbin/badsect sbin/clri sbin/disklabel sbin/dump \
	sbin/dumpfs sbin/fastboot sbin/fsck sbin/halt \
	sbin/ifconfig sbin/mknod sbin/mount sbin/mount sbin/mountd \
	sbin/newfs sbin/nfsd sbin/nfsiod sbin/ping sbin/quotacheck \
	sbin/reboot sbin/restore sbin/route sbin/savecore \
	sbin/shutdown sbin/slattach sbin/tunefs sbin/umount \
	bin bin/cat bin/chmod bin/cp bin/csh bin/date bin/df bin/df bin/echo \
	bin/hostname bin/kill bin/ln bin/ls bin/mkdir bin/mv bin/pwd \
	bin/rcp bin/rm bin/rmail bin/rmdir bin/sh bin/sleep bin/stty bin/sync \
	libexec libexec/bugfiler libexec/comsat libexec/fingerd libexec/ftpd \
	libexec/getNAME libexec/getty libexec/kpasswd libexec/mail.local \
	libexec/makekey libexec/rexecd libexec/rlogind libexec/rshd \
	libexec/talkd libexec/telnetd libexec/tftpd libexec/uucpd \
	${${TARGET_MACHINE}_DIRS}

all :: install

RECURSE = ${RECURSE_TEMPLATE/RECURSE_DIRS/${DIRS}}

install :: mkidirs mkhidirs
	+${RECURSE/RECURSE_TARGET/install}

release :: mkrdirs mkhrdirs
	+${RECURSE/RECURSE_TARGET/release}

clean ::
	+${RECURSE/RECURSE_TARGET/clean}

-include Makedep
