# Generated automatically from Makefile.in by configure.
#
# Main Makefile for Window Maker
#
# Modifications:
#   Nicolai P Guba
#	- Bit of Housekeeping
#	- Added install support for GNUstep diretcory hierarchy
#         (this could be used for all directory installs later, let's
#	   test this on some live stock first...)
#       - migrated Makefile to Makefile.in.  This now implies that
#         the main Makefile is auto-made/configured.
#   Carsten Schaar
#       - Make use of the 'autoconf' output variables for installation
#       - Let 'configure' make the GNUStep hierarchy layout stuff

SHELL       = /bin/sh

# paths

srcdir      = .
top_srcdir  = .
prefix      = /usr/local
exec_prefix = /usr/local

bindir      = ${exec_prefix}/bin
datadir     = ${prefix}/share
libdir      = ${exec_prefix}/lib
infodir     = ${prefix}/info
includedir  = ${prefix}/include

pkgdatadir  = $(datadir)/WindowMaker

# auxiliar paths

hdocdir     = $(pkgdatadir)/Documentation/HTML
pdocdir     = $(pkgdatadir)/Documentation/Postscript
pixmapdir   = ${datadir}/pixmaps
nlsdir      = /usr/lib/locale

# version

include $(top_srcdir)/Version

# programs

MV	= mv -f
RM	= rm -f
CP	= cp -f

#INSTALL = ../install-sh
INSTALL = /usr/bin/install -c
INSTALL_BIN = ${INSTALL}
INSTALL_CFG = ${INSTALL} -m 644
mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs

# extra paths
# 
lib_src      = ./Library



all: config.status 
	(cd wrlib; $(MAKE) all)
	(cd wmlib; $(MAKE) all)
	(cd src; $(MAKE) all)
	$(CP) src/wmaker .
	(cd util; $(MAKE))
	(cd Library/WindowMaker ; $(MAKE) all)
	(cd Documentation; $(MAKE))
	@echo "Done!"

docs: config.status
	(cd Documentation; $(MAKE))

install:
	(cd wmlib; $(MAKE) install)
	(cd src; $(MAKE) install)
	-(cd util; $(MAKE) install)
	-(cd Documentation; $(MAKE) install)
# copy pixmaps to the right place
	$(mkinstalldirs) $(pixmapdir)
	$(CP) pixmaps/* $(pixmapdir)
# copy configuration files to the right place
	$(mkinstalldirs) $(pkgdatadir)
	$(CP) -r $(lib_src)/WindowMaker/* $(pkgdatadir)


clean:
	-$(RM) *~ core
	-(cd wrlib; $(MAKE) clean)
	-(cd wmlib; $(MAKE) clean)
	-(cd src; $(MAKE) clean)
	-(cd test; $(MAKE) clean)
	-(cd util; $(MAKE) clean)
	-(cd Documentation; $(MAKE) clean)

distclean: clean 
	-$(RM) config.log config.status config.cache wmaker gmon.out
	-(cd pixmaps; $(RM) -r .xvpics)
	-(cd Library/WindowMaker; $(MAKE) distclean)
	-(cd src; $(MAKE) distclean)
	-(cd wrlib; $(MAKE) distclean)
	-(cd wmlib; $(MAKE) distclean)
	-(cd test; $(MAKE) distclean)
	-(cd util; $(MAKE) distclean)
	-(cd Documentation; $(MAKE) distclean)

config.status: 
	@echo "	You must configure WindowMaker before typing 'make'."
	@echo "	See INSTALL for installation instructions."
	@echo
	@exit 1

dist:    
	rm -f ../WindowMaker-$(VERSION).tar.gz
	mkdir ../WindowMaker-$(VERSION)
	cp -rd * ../WindowMaker-$(VERSION)
	(cd ../WindowMaker-$(VERSION); $(MAKE) distclean)
	(cd ..; tar czf WindowMaker-$(VERSION).tar.gz WindowMaker-$(VERSION)/*)
	rm -fr ../WindowMaker-$(VERSION)
