# Makefile for Makedist
# ----------------------------------
#
# Makedist 2.0, as of February 06, 1999
#
# (C) 1997 Andreas Kupries <a.kupries@westend.cm>
#
# ----------------------------------
# Some versions of make, like SGI's, use the following variable to
# determine which shell to use for executing commands:
SHELL =		/bin/sh

prefix		=	/usr/local
exec_prefix	=	/usr/local

# Directory to install the packages into
LIBDIR=${exec_prefix}/lib

# Directory to install the application into
BINDIR=${exec_prefix}/bin

# use this command to install the files
INSTALL=cp

# ----------------------------------
# below this line nothing should be modified

Applications	=	makedist tkmakedist
Packages	=	lib support
PKGDIR		=	$(LIBDIR)/Makedist2.0
PKG_BDIR	=	$(LIBDIR)/Makedist_Support2.0

# ----------------------------------

install:	install-lib install-support install-bin

install-bin:
	for i in ${Applications};		\
	do 					\
		$(INSTALL) $$i ${BINDIR};	\
		chmod 755 ${BINDIR}/$$i;	\
	done

install-lib:
	@echo "installing makedist library..."
	-@mkdir           $(PKGDIR)
	@cd lib ; cp -r * $(PKGDIR)
	@cd               $(PKGDIR); rm -f *.cls ; chmod -R 644 * ; chmod 655 `find . -type d`

install-support:
	@echo "installing makedist support library..."
	-@mkdir               $(PKG_BDIR)
	@cd support ; cp -r * $(PKG_BDIR)
	@cd                   $(PKG_BDIR); rm -f *.cls ; chmod -R 644 * ; chmod 655 `find . -type d`

# ----------------------------------
# internal targets to aid development

refresh:
	cd lib	   ; gen_idx
	cd support ; gen_idx

full-refresh:
	cd lib     ; gen_idx ; gen_pkg Makedist 1.0         tclIndex
	cd support ; gen_idx ; gen_pkg Makedist_Support 1.0 tclIndex

clean:
	cd lib     ; rm tclIndex pkgIndex.tcl
	cd support ; rm tclIndex pkgIndex.tcl

