summaryrefslogtreecommitdiff
path: root/man
diff options
context:
space:
mode:
authorPaulo Cesar Pereira de Andrade <pcpa@mandriva.com.br>2009-01-30 20:41:31 -0200
committerPaulo Cesar Pereira de Andrade <pcpa@mandriva.com.br>2009-01-30 20:41:31 -0200
commit3237cc5b45a41ffe93ebde10b1090a7f2db6f88e (patch)
treecf72fc42b228c96d517d5e5ba3abea3b4641122a /man
parent48544103324d1816139dfafe5873a11c88ee05b6 (diff)
Janitor: ansification, make distcheck, compiler warnings.
Manual page generation, and xmlto handling, shamelessly cut&paste'd from libXi/man/Makefile.am, so that make distcheck will work.
Diffstat (limited to 'man')
-rw-r--r--man/.gitignore7
-rw-r--r--man/Makefile.am71
2 files changed, 38 insertions, 40 deletions
diff --git a/man/.gitignore b/man/.gitignore
deleted file mode 100644
index 74c6b15..0000000
--- a/man/.gitignore
+++ /dev/null
@@ -1,7 +0,0 @@
-shadows.DONE
-*.3
-*~
-*.man
-*.__libmansuffix__
-Makefile
-Makefile.in
diff --git a/man/Makefile.am b/man/Makefile.am
index 6a5291a..17553a4 100644
--- a/man/Makefile.am
+++ b/man/Makefile.am
@@ -28,30 +28,30 @@ libmandir = $(LIB_MAN_DIR)
LIB_MAN_DIR_SUFFIX = $(LIB_MAN_DIR:@mandir@/man%=%)
-libman_xml = $(srcdir)/XTest.xml
-
-XTest_manpages = \
- XTestQueryExtension \
- XTestCompareCursorWithWindow \
- XTestCompareCurrentCursorWithWindow \
- XTestFakeKeyEvent \
- XTestFakeButtonEvent \
- XTestFakeMotionEvent \
- XTestFakeRelativeMotionEvent \
- XTestGrabControl \
- XTestSetGContextOfGC \
- XTestSetVisualIDOfVisual \
- XTestDiscard
-
-libman_PRE = $(XTest_manpages:%=%.man)
-
-EXTRA_DIST = $(libman_PRE) $(libman_xml)
+libman_xml = XTest.xml
+
+libman_PRE = \
+ XTestQueryExtension.man \
+ XTestCompareCursorWithWindow.man \
+ XTestCompareCurrentCursorWithWindow.man \
+ XTestFakeKeyEvent.man \
+ XTestFakeButtonEvent.man \
+ XTestFakeMotionEvent.man \
+ XTestFakeRelativeMotionEvent.man \
+ XTestGrabControl.man \
+ XTestSetGContextOfGC.man \
+ XTestSetVisualIDOfVisual.man \
+ XTestDiscard.man
+
+EXTRA_DIST = $(libman_PRE) $(libman_xml) x.stamp
CLEANFILES = $(libman_DATA) $(BUILT_SOURCES)
MAINTAINERCLEANFILES = $(libman_PRE)
+if HAVE_XMLTO
libman_DATA = $(libman_PRE:man=@LIB_MAN_SUFFIX@)
+endif
SED = sed
@@ -72,20 +72,25 @@ SUFFIXES = .$(LIB_MAN_SUFFIX) .man
.man.$(LIB_MAN_SUFFIX):
sed $(MAN_SUBSTS) < $< > $@
-# Generate nroff sources from DocBook/xml
-
-dist-hook: $(libman_PRE)
-
+# This is ugly, but handling of tools with multiple outputs in make is a
+# huge PITA. The commands below are taken from the automake manual:
+# http://www.gnu.org/software/automake/manual/automake.html#Multiple-Outputs
if HAVE_XMLTO
-# The .PHONY intermediate target exists to make parallel builds work.
-.PHONY: do_xmlto_stage
-
-$(libman_PRE): do_xmlto_stage
-
-do_xmlto_stage: $(libman_xml)
- $(XMLTO) man $(libman_xml)
- for m in $(XTest_manpages); do \
- mv -f $$m.__libmansuffix__ $$m.man ; \
+x.stamp: $(libman_xml)
+ @rm -f x.tmp
+ @touch x.tmp
+ $(XMLTO) man $^
+ @for man in $(libman_PRE); do \
+ out=`echo $$man | sed 's/\.man/.__libmansuffix__/'`; \
+ echo mv -f $$out $$man; \
+ mv -f $$out $$man || exit 1; \
done
-
-endif HAVE_XMLTO
+ @mv -f x.tmp $@
+$(libman_PRE): x.stamp
+ @if test -f $@; then :; else \
+ rm -f $<; \
+ $(MAKE) $(AM_MAKEFLAGS) $<; \
+ fi
+CLEANFILES += x.tmp
+MAINTAINERCLEANFILES += x.stamp
+endif # HAVE_XMLTO