Makefile.am revision a253d6ae
1#
2# Copyright 2007 Sun Microsystems, Inc.  All rights reserved.
3# 
4# Permission to use, copy, modify, distribute, and sell this software and its
5# documentation for any purpose is hereby granted without fee, provided that
6# the above copyright notice appear in all copies and that both that
7# copyright notice and this permission notice appear in supporting
8# documentation.
9# 
10# The above copyright notice and this permission notice shall be included
11# in all copies or substantial portions of the Software.
12# 
13# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
14# OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
15# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
16# IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR
17# OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
18# ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
19# OTHER DEALINGS IN THE SOFTWARE.
20# 
21# Except as contained in this notice, the name of the copyright holders shall
22# not be used in advertising or otherwise to promote the sale, use or
23# other dealings in this Software without prior written authorization
24# from the copyright holders.
25# 
26
27libmandir = $(LIB_MAN_DIR)
28
29LIB_MAN_DIR_SUFFIX = $(LIB_MAN_DIR:@mandir@/man%=%)
30
31libman_xml = $(srcdir)/XTest.xml
32
33XTest_manpages =	\
34	XTestQueryExtension                 \
35	XTestCompareCursorWithWindow        \
36	XTestCompareCurrentCursorWithWindow \
37	XTestFakeKeyEvent                   \
38	XTestFakeButtonEvent                \
39	XTestFakeMotionEvent                \
40	XTestFakeRelativeMotionEvent        \
41	XTestGrabControl                    \
42	XTestSetGContextOfGC                \
43	XTestSetVisualIDOfVisual            \
44	XTestDiscard
45
46libman_PRE = $(XTest_manpages:%=%.man)
47
48EXTRA_DIST = $(libman_PRE) $(libman_xml)
49
50CLEANFILES = $(libman_DATA) $(BUILT_SOURCES)
51
52MAINTAINERCLEANFILES = $(libman_PRE)
53
54libman_DATA = $(libman_PRE:man=@LIB_MAN_SUFFIX@)
55
56SED = sed
57
58# Strings to replace in man pages
59XORGRELSTRING = @PACKAGE_STRING@
60  XORGMANNAME = X Version 11
61
62MAN_SUBSTS = \
63	-e 's/__xorgversion__/"$(XORGRELSTRING)" "$(XORGMANNAME)"/' \
64	-e 's/__xservername__/Xorg/g' \
65	-e 's/__xconfigfile__/xorg.conf/g' \
66	-e 's/__appmansuffix__/$(APP_MAN_SUFFIX)/g' \
67	-e 's/__libmansuffix__/$(LIB_MAN_SUFFIX)/g' \
68	-e 's/__filemansuffix__/$(FILE_MAN_SUFFIX)/g'
69
70SUFFIXES = .$(LIB_MAN_SUFFIX) .man
71
72.man.$(LIB_MAN_SUFFIX):
73	sed $(MAN_SUBSTS) < $< > $@
74
75# Generate nroff sources from DocBook/xml
76
77dist-hook: $(libman_PRE)
78
79if HAVE_XMLTO
80$(libman_PRE): $(libman_xml)
81	$(XMLTO) man $(libman_xml)
82	for m in $(XTest_manpages); do \
83	  mv -f $$m.__libmansuffix__ $$m.man ; \
84	done
85
86endif HAVE_XMLTO
87