#
#  Documentation makefile for the GNUstep Xdps Library
#  Copyright (C) 1995 Free Software Foundation, Inc.
#
#  Written by: Adam Fedor <fedor@gnu.org>
#
#  This file is part of the GNUstep Xdps Library.
#
#  This library is free software; you can redistribute it and/or
#  modify it under the terms of the GNU Library General Public
#  License as published by the Free Software Foundation; either
#  version 2 of the License, or (at your option) any later version.
#
#  This library 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
#  Library General Public License for more details.
#
#  You should have received a copy of the GNU Library General Public
#  License along with this library; if not, write to the Free
#  Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111 USA.

# Install into the system root by default
GNUSTEP_INSTALLATION_DIR = $(GNUSTEP_SYSTEM_ROOT)

GNUSTEP_MAKEFILES = $(GNUSTEP_SYSTEM_ROOT)/Makefiles

include $(GNUSTEP_MAKEFILES)/common.make

include ../Version

# The documents to be generated
DOCUMENT_NAME = 

# The text documents to be generated
DOCUMENT_TEXT_NAME = \
INSTALL NEWS README ANNOUNCE 

TOP_DOC_FILES = INSTALL NEWS README ANNOUNCE 

INSTALL_TEXI_FILES = version.tmpl.texi
INSTALL_TEXT_MAIN = install.tmpl.texi

NEWS_TEXI_FILES = version.tmpl.texi
NEWS_TEXT_MAIN = news.tmpl.texi

README_TEXI_FILES = version.tmpl.texi
README_TEXT_MAIN = readme.tmpl.texi

ANNOUNCE_TEXI_FILES = version.tmpl.texi
ANNOUNCE_TEXT_MAIN = announce.tmpl.texi

-include Makefile.preamble

-include GNUmakefile.local

include $(GNUSTEP_MAKEFILES)/documentation.make

-include Makefile.postamble

regenerate: $(DOCUMENT_TEXT_NAME)
	mv $(TOP_DOC_FILES) ..

version.tmpl.texi: ../Version
	rm -f version.tmpl.texi
	echo '@set GNUSTEP-XDPS-VERSION' $(GNUSTEP_XDPS_VERSION) \
		> version.tmpl.texi
	echo '@set GNUSTEP-XDPS-GCC $(GNUSTEP_XDPS_GCC)' \
		>> version.tmpl.texi
	echo '@set GNUSTEP-XDPS-GUI $(GNUSTEP_XDPS_GUI)' \
		>> version.tmpl.texi
	echo '@set GNUSTEP-XDPS-DGS $(GNUSTEP_XDPS_DGS)' \
		>> version.tmpl.texi
	if [ $(GNUSTEP_XDPS_FTP_MACHINE) ]; then \
	  echo '@set GNUSTEP-XDPS-FTP-MACHINE $(GNUSTEP_XDPS_FTP_MACHINE)' \
		>> version.tmpl.texi; fi
	if [ $(GNUSTEP_XDPS_FTP_DIRECTORY) ]; then \
	  echo '@set GNUSTEP-XDPS-FTP-DIRECTORY \
		$(GNUSTEP_XDPS_FTP_DIRECTORY)' \
		>> version.tmpl.texi; fi
	if [ $(GNUSTEP_XDPS_SNAP_FTP_MACHINE) ]; then \
	  echo '@set GNUSTEP-XDPS-SNAP-FTP-MACHINE \
		$(GNUSTEP_XDPS_SNAP_FTP_MACHINE)' \
		>> version.tmpl.texi; fi
	if [ $(GNUSTEP_XDPS_SNAP_FTP_DIRECTORY) ]; then \
	  echo '@set GNUSTEP-XDPS-SNAP-FTP-DIRECTORY \
		$(GNUSTEP_XDPS_SNAP_FTP_DIRECTORY)' \
		>> version.tmpl.texi; fi
	cp version.tmpl.texi version.texi

