#
#  doc makefile for the GNUstep Base Library
#  Copyright (C) 1995 Free Software Foundation, Inc.
#
#  Written by:	Andrew Kachites McCallum <mccallum@gnu.ai.mit.edu>
#
#  This file is part of the GNUstep Base Library.
#
#  This library 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 3 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
#  General Public License for more details.
#
#  You should have received a copy of the GNU General Public
#  License along with this library; if not, write to the Free
#  Software Foundation, Inc., 31 Milk Street #960789 Boston, MA 02196 USA.

ifeq ($(GNUSTEP_MAKEFILES),)
 GNUSTEP_MAKEFILES := $(shell gnustep-config --variable=GNUSTEP_MAKEFILES 2>/dev/null)
  ifeq ($(GNUSTEP_MAKEFILES),)
    $(warning )
    $(warning Unable to obtain GNUSTEP_MAKEFILES setting from gnustep-config!)
    $(warning Perhaps gnustep-make is not properly installed,)
    $(warning so gnustep-config is not in your PATH.)
    $(warning )
    $(warning Your PATH is currently $(PATH))
    $(warning )
  endif
endif

ifeq ($(GNUSTEP_MAKEFILES),)
  $(error You need to set GNUSTEP_MAKEFILES before compiling!)
endif

PACKAGE_NAME = gnustep-base
GNUSTEP_LOCAL_ADDITIONAL_MAKEFILES=../base.make

include $(GNUSTEP_MAKEFILES)/common.make

-include ../Version
-include ../config.mak

# The documents to be generated
DOCUMENT_NAME = coding-standards
ifeq ($(HAVE_LIBXML),1)
DOCUMENT_NAME += ReleaseNotes
endif

SUBPROJECTS = manual General

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

TOP_DOC_FILES = INSTALL NEWS README ANNOUNCE

gnustep-base_TEXI_FILES = \
version.texi \
gnustep-base.texi \
gnustep-zones.texi
gnustep-base_DOC_INSTALL_DIR = Developer/Base/Manual

coding-standards_TEXI_FILES = \
coding-standards.texi
coding-standards_DOC_INSTALL_DIR = Developer/CodingStandards

INSTALL_TEXI_FILES = version.texi
INSTALL_TEXT_MAIN = install.texi
INSTALL_DOC_INSTALL_DIR = Developer/Base/ReleaseNotes/$(VERSION)

NEWS_TEXI_FILES = version.texi
NEWS_TEXT_MAIN = news.texi
NEWS_DOC_INSTALL_DIR = Developer/Base/ReleaseNotes/$(VERSION)

README_TEXI_FILES = version.texi
README_TEXT_MAIN = readme.texi
README_DOC_INSTALL_DIR = Developer/Base/ReleaseNotes/$(VERSION)

ANNOUNCE_TEXI_FILES = version.texi
ANNOUNCE_TEXT_MAIN = announce.texi
ANNOUNCE_DOC_INSTALL_DIR = Developer/Base/ReleaseNotes/$(VERSION)

ReleaseNotes_DOC_INSTALL_DIR =  Developer/Base/

ReleaseNotes_AGSDOC_FILES = \
ReleaseNotes.gsdoc

#
# Hack ... using the -DocumentationDirectory flag overrides the value
# used by the make package, and puts our output in the documentation
# directory.
#
#ReleaseNotes_AGSDOC_FLAGS = -DocumentationDirectory .
ReleaseNotes_AGSDOC_FLAGS = -DTDs ../Tools

# Use local version of autogsdoc in case it is not installed
LD_LIBRARY_PATH := $(dir $(CURDIR))/../Source/$(GNUSTEP_OBJ_DIR_NAME):$(LD_LIBRARY_PATH)
AUTOGSDOC=../Tools/$(GNUSTEP_OBJ_DIR_NAME)/autogsdoc
BASE_MAKE_LOADED=yes

#
# NB. Library reference documentation is generated by rules in the postamble
# file using the make file ../Source/DocMakefile.  If headers are added to the
# library, you need to modify that file to get the autogsdoc tool to use them.
#
REF_DOC_INSTALL_DIR = $(GNUSTEP_DOC)/Developer

-include Makefile.preamble

include $(GNUSTEP_MAKEFILES)/documentation.make
include $(GNUSTEP_MAKEFILES)/aggregate.make

-include Makefile.postamble
