1a253d6aeSmrg#
210f94802Smrg# Copyright (c) 2007, Oracle and/or its affiliates.
325b89263Smrg#
425b89263Smrg# Permission is hereby granted, free of charge, to any person obtaining a
525b89263Smrg# copy of this software and associated documentation files (the "Software"),
625b89263Smrg# to deal in the Software without restriction, including without limitation
725b89263Smrg# the rights to use, copy, modify, merge, publish, distribute, sublicense,
825b89263Smrg# and/or sell copies of the Software, and to permit persons to whom the
925b89263Smrg# Software is furnished to do so, subject to the following conditions:
1025b89263Smrg#
1125b89263Smrg# The above copyright notice and this permission notice (including the next
1225b89263Smrg# paragraph) shall be included in all copies or substantial portions of the
1325b89263Smrg# Software.
1425b89263Smrg#
1525b89263Smrg# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
1625b89263Smrg# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
1725b89263Smrg# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
1825b89263Smrg# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
1925b89263Smrg# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
2025b89263Smrg# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
2125b89263Smrg# DEALINGS IN THE SOFTWARE.
2225b89263Smrg#
23a253d6aeSmrg
24a253d6aeSmrglibmandir = $(LIB_MAN_DIR)
25a253d6aeSmrg
26ea133fd7Smrglibman_xml = XTest.xml
27ea133fd7Smrg
28ea133fd7Smrglibman_PRE =	\
29ea133fd7Smrg	XTestQueryExtension.man \
30ea133fd7Smrg	XTestCompareCursorWithWindow.man \
31ea133fd7Smrg	XTestCompareCurrentCursorWithWindow.man \
32ea133fd7Smrg	XTestFakeKeyEvent.man \
33ea133fd7Smrg	XTestFakeButtonEvent.man \
34ea133fd7Smrg	XTestFakeMotionEvent.man \
35ea133fd7Smrg	XTestFakeRelativeMotionEvent.man \
36ea133fd7Smrg	XTestGrabControl.man \
37ea133fd7Smrg	XTestSetGContextOfGC.man \
38ea133fd7Smrg	XTestSetVisualIDOfVisual.man \
39ea133fd7Smrg	XTestDiscard.man
40ea133fd7Smrg
41ea133fd7SmrgEXTRA_DIST = $(libman_PRE) $(libman_xml) x.stamp
42a253d6aeSmrg
4325b89263SmrgCLEANFILES = $(libman_DATA)
44a253d6aeSmrg
45a253d6aeSmrgMAINTAINERCLEANFILES = $(libman_PRE)
46a253d6aeSmrg
4725b89263Smrgif INSTALL_MANPAGES
48a253d6aeSmrglibman_DATA = $(libman_PRE:man=@LIB_MAN_SUFFIX@)
49ea133fd7Smrgendif
50a253d6aeSmrg
5125b89263Smrg# String replacements in MAN_SUBSTS now come from xorg-macros.m4 via configure
52a253d6aeSmrgSUFFIXES = .$(LIB_MAN_SUFFIX) .man
53a253d6aeSmrg
54a253d6aeSmrg.man.$(LIB_MAN_SUFFIX):
5525b89263Smrg	$(AM_V_GEN)$(SED) $(MAN_SUBSTS) < $< > $@
56a253d6aeSmrg
57ea133fd7Smrg# This is ugly, but handling of tools with multiple outputs in make is a
58ea133fd7Smrg# huge PITA. The commands below are taken from the automake manual:
59ea133fd7Smrg# http://www.gnu.org/software/automake/manual/automake.html#Multiple-Outputs
60a253d6aeSmrgif HAVE_XMLTO
61ea133fd7Smrgx.stamp: $(libman_xml)
62ea133fd7Smrg	@rm -f x.tmp
63ea133fd7Smrg	@touch x.tmp
64ea133fd7Smrg	$(XMLTO) man $^
65ea133fd7Smrg	@for man in $(libman_PRE); do \
66ea133fd7Smrg	  out=`echo $$man | sed 's/\.man/.__libmansuffix__/'`; \
67ea133fd7Smrg	  echo mv -f $$out $$man; \
68ea133fd7Smrg	  mv -f $$out $$man || exit 1; \
69a253d6aeSmrg	done
70ea133fd7Smrg	@mv -f x.tmp $@
71ea133fd7Smrg$(libman_PRE): x.stamp
72ea133fd7Smrg	@if test -f $@; then :; else \
73ea133fd7Smrg	  rm -f $<; \
74ea133fd7Smrg	  $(MAKE) $(AM_MAKEFLAGS) $<; \
75ea133fd7Smrg	fi
76ea133fd7SmrgCLEANFILES += x.tmp
77ea133fd7SmrgMAINTAINERCLEANFILES += x.stamp
78ea133fd7Smrgendif # HAVE_XMLTO
79