#
# Top-level Imakefile for the discuss source hierarchy
#
<<<<<<< Imakefile
# $Id: Imakefile,v 1.2 1992/07/11 22:25:41 raeburn Exp $
# $Source: /mit/discuss/.cvsroot/discuss/source/Imakefile,v $
=======
# $Id: Imakefile,v 1.3 2000/01/04 04:15:20 srz dead $
# $Source: /mit/discuss/.cvsroot/discuss/source/Attic/Imakefile,v $
>>>>>>> 1.3

#ifdef BuildUtils
SUBDIRS	= utils ets include usp libds server client mclient edsc dsgrep
#else
SUBDIRS	= ets include usp libds server client mclient edsc dsgrep
#endif

barf:
	@echo " "
	@echo " "
	@echo ' >>> Please use "make target", where "target" is one'
	@echo ' >>> or more of: world, build, depend, clean, all, or a'
	@echo ' >>> specific local target like Makefile.'
	@echo " "
	@false

world: 
	cd ./config; $(MAKE) -f Makefile.ini clean; $(MAKE) -f Makefile.ini BOOTSTRAPCFLAGS="$(BOOTSTRAPCFLAGS)"
	$(IMAKE) -I./config
	$(MAKE) Makefile
	$(MAKE) build

build:
	$(MAKE) Makefiles
	$(MAKE) clean
#ifdef BuildUtils
	(cd ./utils; $(MAKE) build-utils)
#endif
	(cd ./include; $(MAKE) config)
	$(MAKE) depend
	$(MAKE) all

#define ALL(targ,deps,subdir) targ:deps;(cd subdir ; $(MAKE) $(MFLAGS) all)
ALL(all-client, all-libs, client)
ALL(all-libds, all-utils all-ets, libds)
all-libs: all-libds all-usp
ALL(all-usp, all-utils all-ets, usp)
ALL(all-utils, , utils)
ALL(all-server, all-libs, server)
ALL(all-ets, all-utils, ets)
ALL(all-mclient, all-libs all-client, mclient)

NamedTargetSubdirs(install-server, server, installing server,, install)
NamedTargetSubdirs(install-client, client mclient edsc dsgrep, \
	installing client,, install)
NamedTargetSubdirs(install-client, server, installing client,, installclient)

MakeSubdirs($(SUBDIRS))
CleanSubdirs($(SUBDIRS))
DependSubdirs($(SUBDIRS))
MakefileSubdirs($(SUBDIRS))
InstallSubdirs(client mclient libds edsc dsgrep server)
