# Generated automatically from Makefile.in by configure.
#
#  Documentation makefile for the Display Ghostscript System
#  Copyright (C) 1996 Free Software Foundation, Inc.
#
#  Written by:	Scott Christley <scottc@net-community.com>
#
#  This file is part of the Display Ghostscript System.
#
# This file is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
# General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.  */

SHELL = /bin/sh

#### Start of system configuration section. ####

srcdir = .

# Installation location
prefix = /usr
infodir = $(prefix)/info

MAKEINFO = makeinfo
TEXI2DVI = texi2dvi
TEXI2HTML = texi2html

#### End of system configuration section. ####

include $(srcdir)/../Version

ORIG_FILES = \
version.tmpl.texi \
announce.tmpl.texi \
install.tmpl.texi \
news.tmpl.texi \
readme.tmpl.texi \
status.tmpl.texi \
todo.tmpl.texi \
faq.tmpl.texi

TEXI_FILES = \
version.texi \
announce.texi \
install.texi \
news.texi \
readme.texi \
status.texi \
todo.texi \
faq.texi

TEXT_FILES = \
TODO INSTALL NEWS README ANNOUNCE FAQ STATUS

DVI_FILES = 
PS_FILES = 
HTML_FILES = 
INFO_FILES = 

INFO_FLAGS = -I $(srcdir) -D NO-TEXI2HTML --no-header
HTML_FLAGS = -split_chapter -expandinfo -I $(srcdir)
TEXT_FLAGS = -I $(srcdir) -D NO-TEXI2HTML -D TEXT-ONLY --no-header --no-split

all: text

info: $(INFO_FILES)
dvi: $(DVI_FILES)
html: $(HTML_FILES)
text: $(TEXT_FILES)
ps: $(PS_FILES)

version.tmpl.texi: $(srcdir)/../Version
	rm -f version.tmpl.texi
	echo '@set DGS-VERSION' $(DGS_VERSION) \
		> version.tmpl.texi
	echo '@set DGS-GCC-VERSION $(DGS_GCC_VERSION)' \
		>> version.tmpl.texi
	echo '@set DPSCLIENT-VERSION $(DPSCLIENT_VERSION)' \
		>> version.tmpl.texi
	echo '@set GS-VERSION $(GS_VERSION)' \
		>> version.tmpl.texi
	echo '@set JPEG-VERSION $(JPEG_VERSION)' \
		>> version.tmpl.texi
	echo '@set PNG-VERSION $(PNG_VERSION)' \
		>> version.tmpl.texi
	echo '@set ZLIB-VERSION $(ZLIB_VERSION)' \
		>> version.tmpl.texi
	if [ $(DGS_FTP_MACHINE) ]; then \
		echo '@set DGS-FTP-MACHINE $(DGS_FTP_MACHINE)' \
		>> version.tmpl.texi; fi
	if [ $(DGS_FTP_DIRECTORY) ]; then \
		echo '@set DGS-FTP-DIRECTORY $(DGS_FTP_DIRECTORY)' \
		>> version.tmpl.texi; fi
	if [ $(DGS_SNAP_FTP_MACHINE) ]; then \
		echo '@set DGS-SNAP-FTP-MACHINE $(DGS_SNAP_FTP_MACHINE)' \
		>> version.tmpl.texi; fi
	if [ $(DGS_SNAP_FTP_DIRECTORY) ]; then \
		echo '@set DGS-SNAP-FTP-DIRECTORY $(DGS_SNAP_FTP_DIRECTORY)' \
		>> version.tmpl.texi; fi

# Rules for producing the text files
README: version.tmpl.texi readme.tmpl.texi
	rm -f $(TEXI_FILES)
	for i in $(ORIG_FILES); do \
	   sed -e 's,@email{\([^}]*\)},<\1>,g' \
		$(srcdir)/$$i \
		| sed -e 's,@url{\([^}]*\)},@samp{\1},g' \
		| sed -e 's,@keyword{\([^}]*\)},@strong{\1},g' \
		> `basename $$i .tmpl.texi`.texi ; \
	done
	$(MAKEINFO) $(TEXT_FLAGS) -o README $(srcdir)/readme.texi

ANNOUNCE: version.tmpl.texi announce.tmpl.texi news.tmpl.texi
	rm -f $(TEXI_FILES)
	for i in $(ORIG_FILES); do \
	   sed -e 's,@email{\([^}]*\)},<\1>,g' \
		$(srcdir)/$$i \
		| sed -e 's,@url{\([^}]*\)},@samp{\1},g' \
		| sed -e 's,@keyword{\([^}]*\)},@strong{\1},g' \
		> `basename $$i .tmpl.texi`.texi ; \
	done
	$(MAKEINFO) $(TEXT_FLAGS) -o ANNOUNCE $(srcdir)/announce.texi

INSTALL: version.tmpl.texi install.tmpl.texi
	rm -f $(TEXI_FILES)
	for i in $(ORIG_FILES); do \
	   sed -e 's,@email{\([^}]*\)},<\1>,g' \
		$(srcdir)/$$i \
		| sed -e 's,@url{\([^}]*\)},@samp{\1},g' \
		| sed -e 's,@keyword{\([^}]*\)},@strong{\1},g' \
		> `basename $$i .tmpl.texi`.texi ; \
	done
	$(MAKEINFO) $(TEXT_FLAGS) -o INSTALL $(srcdir)/install.texi

NEWS: version.tmpl.texi news.tmpl.texi
	rm -f $(TEXI_FILES)
	for i in $(ORIG_FILES); do \
	   sed -e 's,@email{\([^}]*\)},<\1>,g' \
		$(srcdir)/$$i \
		| sed -e 's,@url{\([^}]*\)},@samp{\1},g' \
		| sed -e 's,@keyword{\([^}]*\)},@strong{\1},g' \
		> `basename $$i .tmpl.texi`.texi ; \
	done
	$(MAKEINFO) $(TEXT_FLAGS) -o NEWS $(srcdir)/news.texi

FAQ: version.tmpl.texi faq.tmpl.texi
	rm -f $(TEXI_FILES)
	for i in $(ORIG_FILES); do \
	   sed -e 's,@email{\([^}]*\)},<\1>,g' \
		$(srcdir)/$$i \
		| sed -e 's,@url{\([^}]*\)},@samp{\1},g' \
		| sed -e 's,@keyword{\([^}]*\)},@strong{\1},g' \
		> `basename $$i .tmpl.texi`.texi ; \
	done
	$(MAKEINFO) $(TEXT_FLAGS) -o FAQ $(srcdir)/faq.texi

STATUS: version.tmpl.texi status.tmpl.texi
	rm -f $(TEXI_FILES)
	for i in $(ORIG_FILES); do \
	   sed -e 's,@email{\([^}]*\)},<\1>,g' \
		$(srcdir)/$$i \
		| sed -e 's,@url{\([^}]*\)},@samp{\1},g' \
		| sed -e 's,@keyword{\([^}]*\)},@strong{\1},g' \
		> `basename $$i .tmpl.texi`.texi ; \
	done
	$(MAKEINFO) $(TEXT_FLAGS) -o STATUS $(srcdir)/status.texi

TODO: version.tmpl.texi todo.tmpl.texi
	rm -f $(TEXI_FILES)
	for i in $(ORIG_FILES); do \
	   sed -e 's,@email{\([^}]*\)},<\1>,g' \
		$(srcdir)/$$i \
		| sed -e 's,@url{\([^}]*\)},@samp{\1},g' \
		| sed -e 's,@keyword{\([^}]*\)},@strong{\1},g' \
		> `basename $$i .tmpl.texi`.texi ; \
	done
	$(MAKEINFO) $(TEXT_FLAGS) -o TODO $(srcdir)/todo.texi


TOP_DOC_FILES = README INSTALL NEWS
RCS_FILES =  $(TEXI_FILES) Makefile.in 
DIST_FILES = $(RCS_FILES) texinfo.tex \
        $(TOP_DOC_FILES) ANNOUNCE ADVERTISEMENT TODO

# In the future we'll want to install gnustep-base.info and objective-c.info.
install:
uninstall:

update-top: ANNOUNCE FAQ INSTALL NEWS README TODO STATUS
	cp ANNOUNCE ..
	cp FAQ ..
	cp INSTALL ..
	cp NEWS ..
	cp README ..
	cp STATUS ..
	cp TODO ..

mostlyclean:
	rm -f *~
	rm -f *.aux *.cp *.cps *.fn *.fns *.pr *.cl
	rm -f *.ky *.log *.pg *.toc *.tp *.tps *.vr *.vrs
	rm -f $(TEXI_FILES)

clean: mostlyclean
	rm -f version.tmpl.texi
	rm -f $(TEXT_FILES)
	rm -f *.html
	rm -f *.info
	rm -f *.dvi
	rm -f *.ps

distclean: clean
	rm -f Makefile 

maintainer-clean: distclean
	rm -f version.texi \
		README TODO INSTALL NEWS ANNOUNCE

copy-dist: $(DIST_FILES)
	mkdir ../snap/doc
	ln $(DIST_FILES) ../snap/doc
	ln $(TOP_DOC_FILES) ../snap

Makefile: Makefile.in
	cd ..; $(SHELL) config.status
