##############################################################################
#	Instructions to Make, for compilation of MH modules
#
#	@(MHWARNING)
# @(#)$Id: MH-Makefile,v 1.3 1996/09/23 20:42:56 H.Ueno Exp $
##############################################################################

SHELL	=	cmd

# Targets to Make:
#    
#    all:	generate MH system, assumes configuration previously done
#
#    install:	install system
#
#    inst-all:	install system
#
#    mkdirs:	make MH target directories
#
#    uninstall:	undo installation
#    
#    checkout:	MH maintainers only!
#
#    clean:	remove all objects and targets plus clean up
#    
#    unclean:	remove scratch files and backups


##############################################################################
#	Generate MH system
##############################################################################

ALL	=	config sbr mts zotnet uip support doc

all:;		cd config & $(MAKE) all
		cd sbr & $(MAKE) all
		cd mts & $(MAKE) all
		cd zotnet & $(MAKE) all
		cd uip & $(MAKE) all
		cd support & $(MAKE) all
		cd doc & $(MAKE) all


INSTALL	=	zotnet support uip
BINDIR	=	@(MHBINPATH)
ETCDIR	=	@(MHETCPATH)
MANDIR	=	@(MHMANDIR)
SLIB	=	sbr

install:	inst-all

inst-all:	mkdirs inst-lib
		cd zotnet & $(MAKE) inst-all
		cd support & $(MAKE) inst-all
		cd uip & $(MAKE) inst-all

inst-lib:;	cd sbr & $(MAKE) inst-lib

mkdirs:		$(BINDIR) $(ETCDIR)

$(BINDIR) $(ETCDIR):
		crtdir.cmd $@

uninstall:;	for %d in ($(INSTALL)) & do $(SHELL) /c "cd % & $(MAKE) uninstall"


##############################################################################
#	Miscellaneous tasks
##############################################################################

DISTRIBUTION=	config sbr mts zotnet support uip doc

clean:;		rm -f _* core
		for %d in ($(DISTRIBUTION)) do $(SHELL) /c "cd %d & $(MAKE) clean"

unclean:;	rm -f _* core
		for %d in ($(DISTRIBUTION)) do $(SHELL) /c "cd %d & $(MAKE) unclean"
