/*   CrossFire, A Multiplayer game for X-windows
 *
 *   $Id: Imakefile,v 1.4 1998/01/05 10:32:02 master Exp master $
 *
 *   Copyright (C) 1992 Frank Tore Johansen
 *
 *   This program 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.
 *
 *   The author can be reached via e-mail to frankj@ifi.uio.no.
 */

#include "../config/crossfire.tmpl"

#define IHaveSubdirs
#define PassCDebugFLags

SUBDIRS = playbook spoiler spell-docs spoiler-html playbook-html

PFILES = Imakefile Crossedit.doc  \
	PlayerStats README RunTimeCommands SurvivalGuide \
	alchemy.doc crossedit.man \
	crossfire.doc crossfire.man crosslib.doc \
	experience include_html.pl\
	mapguide mapmakers_guide_to_runes maps-README multigod \
	programming_guide skills.doc \
	skills_developer.doc \
	spell_params.doc spell-paths spellcasters_guide_to_runes \
	spells  \
	teleporter.doc xbmtobdf.man

FILES = $(PFILES) handbook.ps spoiler.ps

spoiler.ps: force_depend
	(cd spoiler; $(MAKE) $(MKFLAGS) spoiler)

crosslib.doc: force_depend
	(cd ../common; make doc)

force_depend:

install::

/* InstallManPage(crossfire) */

/* InstallManPage(xledit) */

InstallManPage(crossfire, $(MANDIR))
InstallManPage(xbmtobdf, $(MANDIR))
InstallManPage(crossedit, $(MANDIR))

depend::

clean::

all::

MakeArchive($(SUBDIRS))

MakeSubdirs($(SUBDIRS))

InsertArchive($(FILES),doc)

patchlist::
	@echo $(PFILES) > .patchlist

/* This is a bit of a hack, but should prove handy to make a preformatted
 * only doc archive.  Actually, we are including some extra cruft from the
 * html directories, but oh well.
 */
DTOP=/tmp/$(VERSION)-doc
docarchive::
	mkdir $(DTOP)
	$(CP) $(FILES) $(DTOP)
	$(CP) spoiler.ps handbook.ps $(DTOP)
	cp -r spell-docs spoiler-html playbook-html $(DTOP)
	(cd $(DTOP)/..; gtar cvfhz $(VERSION).doc.tar.gz `$(BASENAME) $(DTOP)`)
	mv $(DTOP)/../$(VERSION).doc.tar.gz ./
	$(RM) -r $(DTOP)
