#include "imake.defs"

SUBDIRS=htool master mkwrap pvmrsh
SHARDIRS=Imakefile READ-ME* Compiling demos icons $(SUBDIRS) imake.defs \
	AIXbuild.sh FAQ HeNCE-1.3-Changes STATUS
SHAR=/src/obj/shar-3.24/shar -S
FILTERS=-e '/.*[-~]$$/d' \
        -e '/.*\.o$$/d' \
        -e '/^demos*\/.*\/[cf]w_.*\.[ch]$$/d' \
	-e '/^demos*\/.*\/fmain\.f$$/d' \
	-e '/^demos*\/.*\/*\.mat$$/d' \
	-e '/\.Z$$/d' \
	-e '/Makefile.bak$$/d' \
	-e '/Makefile$$/d' \
	-e '/core$$/d' \
	-e '/\.rej$$/d' \
	-e '/\/RCS\//d' \
	-e '/\/\.[^\/]*$$/d'

AllTarget($(SUBDIRS))

NamedTargetSubdirs($(SUBDIRS),$(SUBDIRS),"making" all, ,all)

CleanSubdirs($(SUBDIRS))

InstallSubdirs($(SUBDIRS))

MakefileSubdirs($(SUBDIRS))

DependSubdirs($(SUBDIRS))

shar:
	@echo Did you do a "make clean" first'?'
	@echo Cleaning demo directories
	find demos -type d -print | while read dir ; do 		\@@\
		if [ -f $$dir/Makefile ] ; then 			\@@\
			(cd $$dir; make clean);				\@@\
		fi							\@@\
	done
	sleep 10
	chmod +w imake.defs
	find . -name hence.gr -exec chmod +w {} ';'
	find . -name hence.trace -exec chmod +w {} ';'
	find $(SHARDIRS) -type f -print | sort | sed $(FILTERS) | $(SHAR) | compress > HeNCE.sh.Z
