#sccs	@(#)enhancdeds:Makefile	1.3
#	Makefile for Enhanced Editors 9/19/85

include $(MAKEINC)/Makepre.h

UNITS = UNITvi=vi

SUBDIRS = vi

DEPENDLIST = bfs.c

ROOT_PRODUCTS = \
	EDITOR

all: inst_tree Makeincludes bfs comall

inst_tree:
	( \
	if [ -d $(INST_TREE) -a "`uname -n`" != "zeus" ]; \
	then \
		echo "Assuming latest mstr.proto is installed on build machine";\
		cd $(INST_TREE); \
		rm -rf $(ROOT_PRODUCTS); \
		$(MAKE) -i SETS="$(ROOT_PRODUCTS)" all; \
	fi; \
	)

Makeincludes: $(DEPENDLIST)
	$(INCCMD) $(DEPENDLIST) | $(SORT) | $(FILTER) > Makeincludes
	$(MAKE)

includes: comincludes $(DEPENDLIST)
	$(INCCMD) $(DEPENDLIST) | $(SORT) | $(FILTER) > Makeincludes

install: cominstall
	$(INSTALL) -i$(EXITFLAG) bfs $(INSDIR) $(PROTOFILE)
	$(INSTALL) -i$(EXITFLAG) Install%/usr/install/EDITOR $(INSDIR) $(PROTOFILE)
	$(INSTALL) -i$(EXITFLAG) Name%/usr/install/EDITOR $(INSDIR) $(PROTOFILE)
	$(INSTALL) -i$(EXITFLAG) Remove%/usr/install/EDITOR $(INSDIR) $(PROTOFILE)

populate: $(SUBDIRS)
	for D in $(SUBDIRS); \
	do (cd $$D; echo "** $$D **:"; getunit; $(MAKE) populate); \
	done

$(SUBDIRS):
	@$(UNITS) ;echo "Making Directory for $@"; mkdir $@; echo $$UNIT$@ > $@/.unit

id.c: enhancdeds.sl
	mkslid >id.c

clean:  comclean
	rm -f *.o

clobber: clean comclobber
	rm -f bfs

bfs:	bfs.o id.o
	$(LD) -s $(LDFLAGS) $(SHAREDLIB) -o bfs bfs.o id.o -lPW

include Makeincludes
include $(MAKEINC)/Makepost.h
