##########################################################################
#   Instructions to Make, for compilation of ISODE processes
##########################################################################

###############################################################################
#
# $Header: /a/vulcan/xtel/isode/isode-master/RCS/Makefile,v 8.0 91/07/17 12:09:05 isode Rel $
#
# $Log:	Makefile,v $
# Revision 8.0  91/07/17  12:09:05  isode
# Release 7.0
# 
# 
###############################################################################

###############################################################################
#
#				 NOTICE
#
#    Acquisition, use, and distribution of this module and related
#    materials are subject to the restrictions of a license agreement.
#    Consult the Preface in the User's Manual for the full terms of
#    this agreement.
#
###############################################################################


##################################################################
# Here it is...
##################################################################

LIBDIRS	=	h compat psap pepsy
DIRS	=	$(LIBDIRS) support


all:;		@for i in $(DIRS); \
		    do (echo "cd $$i; $(MAKE) all"; \
			      cd $$i; $(MAKE) all); \
		    done

inst-all:	make-dirs
		@for i in $(DIRS); \
		    do (echo "cd $$i; $(MAKE) inst-all"; \
			      cd $$i; $(MAKE) inst-all); \
		    done

make-dirs:;	@for i in $(BINDIR) $(SBINDIR) $(ETCDIR) $(LOGDIR) \
			$(LIBDIR) $(LINTDIR) $(MANDIR) $(MANDIR) \
			$(MANDIR)man1/ $(MANDIR)man5/ $(MANDIR)man8/; \
		    do (echo $$i X | \
			sed -e 's%\(.*\)/ X%if test ! -d \1; then mkdir \1; chmod 555 \1; else true; fi%' | \
			sh -v); \
		    done
		@echo $(LOGDIR) X | \
			sed -e 's%\(.*\)/ X%chmod 777 \1%' | \
			sh -v
		

install:	inst-all clean

lint:;		@for i in $(DIRS); \
		    do (echo "cd $$i; $(MAKE) lint"; \
			      cd $$i; $(MAKE) lint); \
		    done

clean:;		rm -f *.a *.so* llib-l* _* *.tmp config/_* util/inst-man.sh
		@for i in $(DIRS) ; \
		    do (echo "cd $$i; $(MAKE) clean"; \
			      cd $$i; $(MAKE) clean); \
		    done

grind:;		@for i in $(DIRS) ; \
		    do (echo "cd $$i; $(MAKE) grind"; \
			      cd $$i; $(MAKE) grind); \
		    done

##################################################################
# everything
##################################################################

everything:	all true
		@echo "a great album by mtr's favorite rock band"
		@echo "sh \"whois -name mtr -info 'favorite rock band'\""

inst-everything: inst-all true

lint-everything: lint true

true:;


##################################################################
# zap
##################################################################

zap:;	rm -f $(LIBDIR)libicompat.a \
	    $(LIBDIR)libpsap.a     \
	    $(LIBDIR)libisode.a
	rm -f $(LINTDIR)llib-licompat* \
	    $(LINTDIR)llib-lpsap*     \
	    $(LINTDIR)llib-lisode*
