summaryrefslogtreecommitdiff
path: root/Makefile.am
diff options
context:
space:
mode:
authorAlan Coopersmith <alan.coopersmith@sun.com>2009-10-17 13:06:26 -0700
committerAlan Coopersmith <alan.coopersmith@sun.com>2009-10-17 13:06:26 -0700
commit628b125ff9c72ec93090005b06228690f0dd6004 (patch)
tree223ad84ffcd23432e441be1a7aec79a145e95e1a /Makefile.am
parent3b0fc7a5a6d4b4b6903a9ad6685e2441f9fe83a7 (diff)
downloadxorg-lib-libxtrans-628b125ff9c72ec93090005b06228690f0dd6004.tar.gz
Move Xtrans interface docs from xorg-docs module
Only built/installed if --enable-docs is requested, since few people should be writing code using xtrans interfaces directly. Signed-off-by: Alan Coopersmith <alan.coopersmith@sun.com>
Diffstat (limited to 'Makefile.am')
-rw-r--r--Makefile.am44
1 files changed, 43 insertions, 1 deletions
diff --git a/Makefile.am b/Makefile.am
index d816eb2..fa6ef15 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -15,7 +15,7 @@ aclocal_DATA = xtrans.m4
pkgconfigdir = $(datadir)/pkgconfig
pkgconfig_DATA = xtrans.pc
-EXTRA_DIST = xtrans.pc.in ${aclocal_DATA} ChangeLog
+EXTRA_DIST = xtrans.pc.in ${aclocal_DATA} ChangeLog Xtrans.mm
MAINTAINERCLEANFILES = ChangeLog
@@ -25,3 +25,45 @@ ChangeLog:
$(CHANGELOG_CMD)
dist-hook: ChangeLog
+
+# Rules to convert documentation from troff to other formats
+doc_sources = Xtrans.mm
+
+if HAVE_PS2PDF
+printable_format = .pdf
+else
+printable_format = .ps
+endif
+
+if BUILD_DOCS
+doc_DATA = $(doc_sources:.mm=.txt) \
+ $(doc_sources:.mm=$(printable_format)) \
+ $(doc_sources:.mm=.html)
+
+CLEANFILES = $(doc_DATA)
+MOSTLYCLEANFILES = index.*
+
+# Pass version string as a troff string for substitution
+GROFF_DEFS = -dxV="$(PACKAGE_STRING)"
+
+# -t to run through tbl
+GROFF_FLAGS = -t -mm $(GROFF_DEFS)
+
+SUFFIXES = .mm .ps .txt .html .pdf
+
+.mm.ps:
+ -$(AM_V_GEN) $(GROFF) -Tps $(GROFF_FLAGS) $< 2> index.$@.raw > $@
+ @if grep '^[^1-9.]' index.$@.raw | grep -v warning; then exit 1; \
+ else test $$? -le 1; fi
+
+.mm.txt:
+ $(AM_V_GEN) env GROFF_NO_SGR=TRUE $(GROFF) -Tutf8 $(GROFF_FLAGS) \
+ $< 2> index.$@.raw > $@
+
+.mm.html:
+ $(AM_V_GEN) $(GROFF) -Thtml $(GROFF_FLAGS) $< 2> index.$@.raw > $@
+
+.ps.pdf:
+ $(AM_V_GEN) $(PS2PDF) $< $@
+
+endif BUILD_DOCS