Makefile.am revision ea133fd7
1a253d6aeSmrg#
2a253d6aeSmrg# Copyright 2007 Sun Microsystems, Inc.  All rights reserved.
3a253d6aeSmrg# 
4a253d6aeSmrg# Permission to use, copy, modify, distribute, and sell this software and its
5a253d6aeSmrg# documentation for any purpose is hereby granted without fee, provided that
6a253d6aeSmrg# the above copyright notice appear in all copies and that both that
7a253d6aeSmrg# copyright notice and this permission notice appear in supporting
8a253d6aeSmrg# documentation.
9a253d6aeSmrg# 
10a253d6aeSmrg# The above copyright notice and this permission notice shall be included
11a253d6aeSmrg# in all copies or substantial portions of the Software.
12a253d6aeSmrg# 
13a253d6aeSmrg# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
14a253d6aeSmrg# OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
15a253d6aeSmrg# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
16a253d6aeSmrg# IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR
17a253d6aeSmrg# OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
18a253d6aeSmrg# ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
19a253d6aeSmrg# OTHER DEALINGS IN THE SOFTWARE.
20a253d6aeSmrg# 
21a253d6aeSmrg# Except as contained in this notice, the name of the copyright holders shall
22a253d6aeSmrg# not be used in advertising or otherwise to promote the sale, use or
23a253d6aeSmrg# other dealings in this Software without prior written authorization
24a253d6aeSmrg# from the copyright holders.
25a253d6aeSmrg# 
26a253d6aeSmrg
27a253d6aeSmrglibmandir = $(LIB_MAN_DIR)
28a253d6aeSmrg
29a253d6aeSmrgLIB_MAN_DIR_SUFFIX = $(LIB_MAN_DIR:@mandir@/man%=%)
30a253d6aeSmrg
31ea133fd7Smrglibman_xml = XTest.xml
32ea133fd7Smrg
33ea133fd7Smrglibman_PRE =	\
34ea133fd7Smrg	XTestQueryExtension.man \
35ea133fd7Smrg	XTestCompareCursorWithWindow.man \
36ea133fd7Smrg	XTestCompareCurrentCursorWithWindow.man \
37ea133fd7Smrg	XTestFakeKeyEvent.man \
38ea133fd7Smrg	XTestFakeButtonEvent.man \
39ea133fd7Smrg	XTestFakeMotionEvent.man \
40ea133fd7Smrg	XTestFakeRelativeMotionEvent.man \
41ea133fd7Smrg	XTestGrabControl.man \
42ea133fd7Smrg	XTestSetGContextOfGC.man \
43ea133fd7Smrg	XTestSetVisualIDOfVisual.man \
44ea133fd7Smrg	XTestDiscard.man
45ea133fd7Smrg
46ea133fd7SmrgEXTRA_DIST = $(libman_PRE) $(libman_xml) x.stamp
47a253d6aeSmrg
48a253d6aeSmrgCLEANFILES = $(libman_DATA) $(BUILT_SOURCES)
49a253d6aeSmrg
50a253d6aeSmrgMAINTAINERCLEANFILES = $(libman_PRE)
51a253d6aeSmrg
52ea133fd7Smrgif HAVE_XMLTO
53a253d6aeSmrglibman_DATA = $(libman_PRE:man=@LIB_MAN_SUFFIX@)
54ea133fd7Smrgendif
55a253d6aeSmrg
56a253d6aeSmrgSED = sed
57a253d6aeSmrg
58a253d6aeSmrg# Strings to replace in man pages
59a253d6aeSmrgXORGRELSTRING = @PACKAGE_STRING@
60a253d6aeSmrg  XORGMANNAME = X Version 11
61a253d6aeSmrg
62a253d6aeSmrgMAN_SUBSTS = \
63a253d6aeSmrg	-e 's/__xorgversion__/"$(XORGRELSTRING)" "$(XORGMANNAME)"/' \
64a253d6aeSmrg	-e 's/__xservername__/Xorg/g' \
65a253d6aeSmrg	-e 's/__xconfigfile__/xorg.conf/g' \
66a253d6aeSmrg	-e 's/__appmansuffix__/$(APP_MAN_SUFFIX)/g' \
67a253d6aeSmrg	-e 's/__libmansuffix__/$(LIB_MAN_SUFFIX)/g' \
68a253d6aeSmrg	-e 's/__filemansuffix__/$(FILE_MAN_SUFFIX)/g'
69a253d6aeSmrg
70a253d6aeSmrgSUFFIXES = .$(LIB_MAN_SUFFIX) .man
71a253d6aeSmrg
72a253d6aeSmrg.man.$(LIB_MAN_SUFFIX):
73a253d6aeSmrg	sed $(MAN_SUBSTS) < $< > $@
74a253d6aeSmrg
75ea133fd7Smrg# This is ugly, but handling of tools with multiple outputs in make is a
76ea133fd7Smrg# huge PITA. The commands below are taken from the automake manual:
77ea133fd7Smrg# http://www.gnu.org/software/automake/manual/automake.html#Multiple-Outputs
78a253d6aeSmrgif HAVE_XMLTO
79ea133fd7Smrgx.stamp: $(libman_xml)
80ea133fd7Smrg	@rm -f x.tmp
81ea133fd7Smrg	@touch x.tmp
82ea133fd7Smrg	$(XMLTO) man $^
83ea133fd7Smrg	@for man in $(libman_PRE); do \
84ea133fd7Smrg	  out=`echo $$man | sed 's/\.man/.__libmansuffix__/'`; \
85ea133fd7Smrg	  echo mv -f $$out $$man; \
86ea133fd7Smrg	  mv -f $$out $$man || exit 1; \
87a253d6aeSmrg	done
88ea133fd7Smrg	@mv -f x.tmp $@
89ea133fd7Smrg$(libman_PRE): x.stamp
90ea133fd7Smrg	@if test -f $@; then :; else \
91ea133fd7Smrg	  rm -f $<; \
92ea133fd7Smrg	  $(MAKE) $(AM_MAKEFLAGS) $<; \
93ea133fd7Smrg	fi
94ea133fd7SmrgCLEANFILES += x.tmp
95ea133fd7SmrgMAINTAINERCLEANFILES += x.stamp
96ea133fd7Smrgendif # HAVE_XMLTO
97