
# ------------------------------------------------------------------------
#       Makefile for BLT distribution
# ------------------------------------------------------------------------

# ------------------------------------------------------------------------
#       Source and target installation directories
# ------------------------------------------------------------------------

prefix =	@prefix@
exec_prefix  =	@exec_prefix@
srcdir =	@srcdir@
bindir =	@bindir@
includedir =	@includedir@
libdir =	@libdir@
version =	@BLT_VERSION@
scriptdir =	$(prefix)/lib/blt$(version)

instdirs =	$(prefix) $(exec_prefix) $(bindir) $(libdir) $(includedir)

# ------------------------------------------------------------------------
#       Don't edit anything beyond this point
# ------------------------------------------------------------------------

INSTALL =	@INSTALL@
INSTALL_DATA =	@INSTALL_DATA@
SHELL =		/bin/sh
RM =		rm -f

subdirs =	src library man demos 

all:  
	(cd src; $(MAKE) all)
	(cd library; $(MAKE) all)
	(cd man; $(MAKE) all)
	(cd demos; $(MAKE) all)

install: install-all install-dirs install-readme

install-all:
	(cd src; $(MAKE) install)
	(cd library; $(MAKE) install)
	(cd man; $(MAKE) install)
	(cd demos; $(MAKE) install)

install-dirs:
	@for i in $(instdirs) ; do \
	    if test ! -d $$i ; then \
		echo " mkdir $$i" ; \
		mkdir $$i ; \
	    fi ; \
        done

install-readme:
	$(INSTALL_DATA) $(srcdir)/README $(scriptdir)
	$(INSTALL_DATA) $(srcdir)/PROBLEMS $(scriptdir)
	$(INSTALL_DATA) $(srcdir)/NEWS $(scriptdir)

clean:
	(cd src; $(MAKE) clean)
	(cd library; $(MAKE) clean)
	(cd man; $(MAKE) clean)
	(cd demos; $(MAKE) clean)
	$(RM) *.bak *\~ "#"* *pure* .pure*

GENERATED_FILES = \
	config.status config.cache config.log Makefile 

distclean: clean
	$(RM) $(GENERATED_FILES)
