XCOMM $XFree86: xc/programs/Xserver/hw/xfree86/doc/sgml/Imakefile,v 3.93 2007/08/03 17:20:50 tsi Exp $

#include <Server.tmpl>
#include <lnxdoc.rules>

/* Set this to YES if the RELNOTES file is up to date (and during devel) */
#ifndef BuildRelnotes
#define BuildRelnotes YES
#endif

#if BuildRelnotes
RELNOTES=RELNOTES.sgml
#endif

#if BuildDmx
DMXDOCS = $(SERVERSRC)/hw/dmx/doc/dmx.sgml $(SERVERSRC)/hw/dmx/doc/scaled.sgml
#endif

SGMLDEPENDS = defs.ent
MANSGMLDEPENDS = mdefs.ent
  INDEXLIST = README.sgml $(RELNOTES) LICENSE.sgml Install.sgml \
	      BUILD.sgml DESIGN.sgml Versions.sgml \
	      mouse.sgml fonts.sgml DRI.sgml DRIcomp.sgml dps.sgml \
	      XKB-Config.sgml XKB-Enhancing.sgml \
	      Darwin.sgml isc.sgml LynxOS.sgml NetBSD.sgml OpenBSD.sgml \
	      OS2Notes.sgml SCO.sgml Solaris.sgml \
	      $(DMXDOCS) \
              apm.sgml ati.sgml chips.sgml cyrix.sgml DECtga.sgml \
	      I128.sgml i740.sgml i810.sgml newport.sgml \
	      r128.sgml rendition.sgml s3virge.sgml SiS.sgml
FORMATTEDDIR = ..

LinuxDocReadmeTarget(Darwin)
LinuxDocReadmeTarget(isc)
LinuxDocReadmeTarget(LynxOS)
LinuxDocReadmeTarget(NetBSD)
LinuxDocReadmeTarget(OpenBSD)
LinuxDocTargetLong(OS2Notes.sgml,OS2.Notes,OS2Notes)
LinuxDocReadmeTarget(SCO)
LinuxDocReadmeTarget(Solaris)

/* Hardware docs */
LinuxDocReadmeTarget(apm)
LinuxDocReadmeTarget(ati)
LinuxDocReadmeTarget(chips)
LinuxDocReadmeTarget(cyrix)
LinuxDocReadmeTarget(DECtga)
LinuxDocReadmeTarget(I128)
LinuxDocReadmeTarget(i740)
LinuxDocReadmeTarget(i810)
LinuxDocReadmeTarget(newport)
LinuxDocReadmeTarget(r128)
LinuxDocReadmeTarget(rendition)
LinuxDocReadmeTarget(s3virge)
LinuxDocReadmeTarget(SiS)

/* Main docs */
LinuxDocTarget(BUILD)
LinuxDocTarget(DESIGN)
LinuxDocTarget(Install)
LinuxDocTarget(LICENSE)
LinuxDocTarget(README)
#if BuildRelnotes
LinuxDocTarget(RELNOTES)
#endif
#if 0
LinuxDocTarget(Status)
#endif

/* Other docs */
LinuxDocReadmeTarget(fonts)
LinuxDocReadmeTarget(mouse)
LinuxDocTarget(Versions)
LinuxDocReadmeTarget(DRI)
LinuxDocReadmeTarget(DRIcomp)
LinuxDocReadmeTarget(dps)
LinuxDocReadmeTarget(XKB-Config)
LinuxDocReadmeTarget(XKB-Enhancing)

SGMLMANDEFS=-D__drivermansuffix__='"$(DRIVERMANSUFFIX)"' \
	    -D__filemansuffix__='"$(FILEMANSUFFIX)"' \
	    -D__miscmansuffix__='"$(MISCMANSUFFIX)"'

#if BuildHtmlManPages
HTMLMANDEFS=-DHTML_MANPAGES
#endif

#if BuildSpecsDocs && defined(HTMLroffCmd)
HTMLSPECDEFS=-DHTML_SPECS
#endif

AllTarget(mdefs.ent)
CppRawFileTarget(mdefs.ent,mdefs.cpp,$(SGMLMANDEFS) $(HTMLMANDEFS) $(HTMLSPECDEFS),NullParameter)

/* Generate the documentation index */
index.sgml: $(INDEXLIST) index.pre index.post add.sh Imakefile $(SGMLDEPENDS) $(MANSGMLDEPENDS)
	RemoveFile(index.sgml)
	cat index.pre > index.sgml
	echo "<!-- This file is auto-generated.  Do not edit! -->" >> index.sgml
	for i in $(INDEXLIST); do \
		$(SHELL) add.sh $$i; \
	done
	cat index.post >> index.sgml

LinuxDocTarget(index)

clean::
	RemoveFile(index.sgml)

#if XFree86Devel

lindex.sgml: $(INDEXLIST) index.pre index.post add.sh Imakefile $(SGMLDEPENDS) $(MANSGMLDEPENDS)
	RemoveFile(lindex.sgml)
	cat index.pre > lindex.sgml
	echo "<!-- This file is auto-generated.  Do not edit! -->" >> lindex.sgml
	for i in $(INDEXLIST); do \
		$(SHELL) add.sh -f lindex.sgml -p ./ $$i; \
	done
	cat index.post >> lindex.sgml

LinuxDocTarget(lindex)

clean::
	RemoveFile(lindex.sgml)

#endif

/* Update top level docs. */
UpdateFormattedDocLong(README,$(TOP),README.txt)
UpdateFormattedDocLong(Install,$(TOP),Install.txt)
UpdateFormattedDocLong(BUILD,$(TOP),BUILD.txt)
UpdateFormattedDocLong(LICENSE,$(TOP),LICENSE.txt)
#if BuildRelnotes
UpdateFormattedDocLong(RELNOTES,$(TOP),RELNOTES.txt)
#endif

/* Update the README files in xc/programs/xkbcomp */
UpdateFormattedDocLong(README.XKB-Config,$(PROGRAMSRC)/xkbcomp,README.config)
UpdateFormattedDocLong(README.XKB-Enhancing,$(PROGRAMSRC)/xkbcomp,README.enhancing)

