# @(#)$Mu: mgv/doc/GNUmakefile,v 1.41 $

##
## GNUmakefile
##	GNU Makefile for the mgv documentation.
##
## Copyright (C) 1996  Eric A. Howe
##
## 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.
##
##   Authors:	Matthew D. Francey
##		Eric A. Howe (mu@trends.net)
##

##
## This Makefile requires GNU Make
##

##
## get things that everyone might need
##
include	../make/top.mk

##
## get the system dependent definitions
##
include	$(top)/make/sys.mk

##
## Figures for the PostScript document
##
buttons = next.gif prev.gif toc.gif
eps = $(subst .gif,.ps, $(filter-out $(buttons), $(wildcard *.gif)))

clean  = mgv.sg.bak mgv*.dvi mgv-a4.sgml
#rclean = mgv.sgml mgv.txt mgv.ps mgv-a4.ps mgv*.html HISTORY INSTALL $(eps)

spellcheck-s = mgv.sg

all::  sgml ps txt html HISTORY INSTALL
sgml:: mgv.sgml
ps::   mgv.ps mgv-a4.ps
txt::  mgv.txt
html:: mgv.html
eps::  $(eps)
mgv.ps mgv-a4.ps:: $(eps)

docs = $(wildcard *.txt mgv.ps mgv-a4.ps *.html *.sgml *.gif) COPYING-2.0

##
## since I don't have makedepend for sgml, I'll do these by hand
##
mgv.sgml:: $(wildcard $(top)/wlib/wlib/*.isgml) COPYING-2.0

HISTORY:: mgv.sgml
	$(top)/tools/yanksect --section='History' < $< > $@.sgml
	sgml2txt -f $@.sgml
	mv $@.txt $@; rm $@.sgml

INSTALL:: mgv.sgml
	$(top)/tools/yanksect --section='Installing and Porting' < $< > $@.sgml
	sgml2txt -f $@.sgml
	mv $@.txt $@; rm $@.sgml

##
## Extra splash screen things.
## The docs are really the application library files for MGv so the
## splash screen goop goes here.
##
install-bin::
	$(mkdir) $(libdir)
	$(install) $(libflags) splash.xpm $(libdir)/splash.xpm
	$(install) $(libflags) splash.xbm $(libdir)/splash.xbm

##
## and the rules
##
include $(top)/make/rules.mk
