#
#  Documentation makefile for the GNUstep GUI Library
#  Copyright (C) 1995 Free Software Foundation, Inc.
#
#  Written by: Adam Fedor <fedor@gnu.org>
#
#  This file is part of the GNUstep GUI 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 = gnustep-gui

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

gnustep-gui_TEXI_FILES = \
gnustep-gui.tmpl.texi \
version.tmpl.texi 

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-GUI-VERSION' $(GNUSTEP_GUI_VERSION) \
		> version.tmpl.texi
	echo '@set GNUSTEP-GUI-GCC $(GNUSTEP_GUI_GCC)' \
		>> version.tmpl.texi
	echo '@set GNUSTEP-GUI-BASE $(GNUSTEP_GUI_BASE)' \
		>> version.tmpl.texi
	echo '@set LIB-FOUNDATION $(LIB_FOUNDATION)' \
		>> version.tmpl.texi
	echo '@set GNUSTEP-GUI-LIBTIFF $(GNUSTEP_GUI_LIBTIFF)' \
		>> version.tmpl.texi
	echo '@set GNUSTEP-GUI-DGS $(GNUSTEP_GUI_DGS)' \
		>> version.tmpl.texi
	echo '@set GNUSTEP-GUI-DPSCLIENT $(GNUSTEP_GUI_DPSCLIENT)' \
		>> version.tmpl.texi
	if [ $(GNUSTEP_GUI_FTP_MACHINE) ]; then \
	  echo '@set GNUSTEP-GUI-FTP-MACHINE $(GNUSTEP_GUI_FTP_MACHINE)' \
		>> version.tmpl.texi; fi
	if [ $(GNUSTEP_GUI_FTP_DIRECTORY) ]; then \
	  echo '@set GNUSTEP-GUI-FTP-DIRECTORY $(GNUSTEP_GUI_FTP_DIRECTORY)' \
		>> version.tmpl.texi; fi
	if [ $(GNUSTEP_GUI_SNAP_FTP_MACHINE) ]; then \
	  echo '@set GNUSTEP-GUI-SNAP-FTP-MACHINE \
		$(GNUSTEP_GUI_SNAP_FTP_MACHINE)' \
		>> version.tmpl.texi; fi
	if [ $(GNUSTEP_GUI_SNAP_FTP_DIRECTORY) ]; then \
	  echo '@set GNUSTEP-GUI-SNAP-FTP-DIRECTORY \
		$(GNUSTEP_GUI_SNAP_FTP_DIRECTORY)' \
		>> version.tmpl.texi; fi
	cp version.tmpl.texi version.texi

