Makefile.am revision e35772b2
172b676d7Smrg#
272b676d7Smrg# Copyright 2005 Sun Microsystems, Inc.  All rights reserved.
3e35772b2Smrg#
4e35772b2Smrg# Permission is hereby granted, free of charge, to any person obtaining a
5e35772b2Smrg# copy of this software and associated documentation files (the "Software"),
6e35772b2Smrg# to deal in the Software without restriction, including without limitation
7e35772b2Smrg# the rights to use, copy, modify, merge, publish, distribute, sublicense,
8e35772b2Smrg# and/or sell copies of the Software, and to permit persons to whom the
9e35772b2Smrg# Software is furnished to do so, subject to the following conditions:
10e35772b2Smrg#
11e35772b2Smrg# The above copyright notice and this permission notice (including the next
12e35772b2Smrg# paragraph) shall be included in all copies or substantial portions of the
13e35772b2Smrg# Software.
14e35772b2Smrg#
15e35772b2Smrg# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16e35772b2Smrg# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17e35772b2Smrg# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
18e35772b2Smrg# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19e35772b2Smrg# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
20e35772b2Smrg# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
21e35772b2Smrg# DEALINGS IN THE SOFTWARE.
2272b676d7Smrg# 
2372b676d7Smrg
2472b676d7Smrgdrivermandir = $(DRIVER_MAN_DIR)
2572b676d7Smrg
2672b676d7Smrgdriverman_PRE = @DRIVER_NAME@.man
2772b676d7Smrg
2872b676d7Smrgdriverman_DATA = $(driverman_PRE:man=@DRIVER_MAN_SUFFIX@)
2972b676d7Smrg
3072b676d7SmrgEXTRA_DIST = @DRIVER_NAME@.man
3172b676d7Smrg
3272b676d7SmrgCLEANFILES = $(driverman_DATA)
3372b676d7Smrg
3472b676d7SmrgSED = sed
3572b676d7Smrg
3672b676d7Smrg# Strings to replace in man pages
3772b676d7SmrgXORGRELSTRING = @PACKAGE_STRING@
3872b676d7Smrg  XORGMANNAME = X Version 11
3972b676d7Smrg
4072b676d7SmrgMANDEFS =  \
4172b676d7Smrg	-D__vendorversion__="\"$(XORGRELSTRING)\" \"$(XORGMANNAME)\"" \
4272b676d7Smrg	-D__appmansuffix__=$(APP_MAN_SUFFIX) \
4372b676d7Smrg	-D__filemansuffix__=$(FILE_MAN_SUFFIX) \
4472b676d7Smrg	-D__libmansuffix__=$(LIB_MAN_SUFFIX) \
4572b676d7Smrg	-D__miscmansuffix__=$(MISC_MAN_SUFFIX) \
4672b676d7Smrg	-D__drivermansuffix__=$(DRIVER_MAN_SUFFIX) \
4772b676d7Smrg	-D__adminmansuffix__=$(ADMIN_MAN_SUFFIX) \
4872b676d7Smrg	-D__xconfigfile__=xorg.conf \
4972b676d7Smrg	-D__xservername__=Xorg
5072b676d7Smrg
5172b676d7Smrg# Translate XCOMM into pound sign with sed, rather than passing -DXCOMM=XCOMM
5272b676d7Smrg# to cpp, because that trick does not work on all ANSI C preprocessors.
5372b676d7Smrg# Delete line numbers from the cpp output (-P is not portable, I guess).
5472b676d7Smrg# Allow XCOMM to be preceded by whitespace and provide a means of generating
5572b676d7Smrg# output lines with trailing backslashes.
5672b676d7Smrg# Allow XHASH to always be substituted, even in cases where XCOMM isn't.
5772b676d7Smrg
5872b676d7SmrgCPP_SED_MAGIC = $(SED) -e '/^\#  *[0-9][0-9]*  *.*$$/d' \
5972b676d7Smrg                       -e '/^\#line  *[0-9][0-9]*  *.*$$/d' \
6072b676d7Smrg                       -e '/^[         ]*XCOMM$$/s/XCOMM/\#/' \
6172b676d7Smrg                       -e '/^[         ]*XCOMM[^a-zA-Z0-9_]/s/XCOMM/\#/' \
6272b676d7Smrg                       -e '/^[         ]*XHASH/s/XHASH/\#/' \
6372b676d7Smrg                       -e '/\@\@$$/s/\@\@$$/\\/'
6472b676d7Smrg
6572b676d7SmrgSUFFIXES = .$(DRIVER_MAN_SUFFIX) .man
6672b676d7Smrg
6772b676d7Smrg.man.$(DRIVER_MAN_SUFFIX):
6872b676d7Smrg	$(RAWCPP) $(RAWCPPFLAGS) $(MANDEFS) $(EXTRAMANDEFS) < $< | $(CPP_SED_MAGIC) > $@
6972b676d7Smrg
70