# 
# 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.

MKHIDIRS = include bin lib etc man man/man1 man/man2 man/man3
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_bin host_bin/ascpp host_lib host_lib/libcmucs \
	host_bin/md host_bin/wh host_bin/xstrip

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

STANDARD_DIRS = bin/gdb-3.5 bin/w
PMAX_DIRS = ${STANDARD_DIRS}
I386_DIRS = ${STANDARD_DIRS}
SUN3_DIRS = ${STANDARD_DIRS}
VAX_DIRS = ${STANDARD_DIRS}
LUNA88K_DIRS = bin/ascpp

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

DIRS =  ${${HOST_MACHINE}_hack?:${XCOMPILE_DIRS}} \
	include lib lib/libmachid lib/libnetname lib/libxmm lib/libenv \
	lib/libcmucs lib/libservice lib/libnetmemory lib/libreadline \
	bin bin/wh bin/md bin/massign bin/envmgr bin/macherr \
	bin/waitfor bin/ipc_test bin/machid bin/ps bin/snames bin/top \
	bin/xstrip bin/zprint bin/mach3 bin/xptest bin/hash_info \
	bin/netmemoryserver bin/vmstat bin/mcreate bin/mkill bin/mnice \
	bin/mpolicy bin/ms bin/pinfo bin/stacks bin/thstate bin/vminfo \
	bin/vmread bin/vmsearch bin/machipc etc etc/mach_init bin/swapon \
	${${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
