#
# Top-level Imakefile for the discuss source hierarchy
#
# $Id: Imakefile,v 1.2 1992/07/11 22:25:41 raeburn Exp $
# $Source: /afs/sipb.mit.edu/project/discuss/.cvsroot/discuss/source/Imakefile,v $

#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

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

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