~ubuntu-branches/ubuntu/intrepid/xserver-xgl/intrepid

« back to all changes in this revision

Viewing changes to cpprules.in

  • Committer: Bazaar Package Importer
  • Author(s): Matthew Garrett
  • Date: 2006-02-13 14:21:43 UTC
  • Revision ID: james.westby@ubuntu.com-20060213142143-mad6z9xzem7hzxz9
Tags: upstream-7.0.0
ImportĀ upstreamĀ versionĀ 7.0.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#                                                       -*- Makefile -*-
 
2
# Rules for generating files using the C pre-processor
 
3
# (Replaces CppFileTarget from Imake)
 
4
 
 
5
SED = sed
 
6
 
 
7
SUFFIXES = .pre .man .man.pre
 
8
 
 
9
# Translate XCOMM into pound sign with sed, rather than passing -DXCOMM=XCOMM
 
10
# to cpp, because that trick does not work on all ANSI C preprocessors.
 
11
# Delete line numbers from the cpp output (-P is not portable, I guess).
 
12
# Allow XCOMM to be preceded by whitespace and provide a means of generating
 
13
# output lines with trailing backslashes.
 
14
# Allow XHASH to always be substituted, even in cases where XCOMM isn't.
 
15
 
 
16
CPP_SED_MAGIC = $(SED) -e '/^\#  *[0-9][0-9]*  *.*$$/d' \
 
17
                       -e '/^\#line  *[0-9][0-9]*  *.*$$/d' \
 
18
                       -e '/^[         ]*XCOMM$$/s/XCOMM/\#/' \
 
19
                       -e '/^[         ]*XCOMM[^a-zA-Z0-9_]/s/XCOMM/\#/' \
 
20
                       -e '/^[         ]*XHASH/s/XHASH/\#/' \
 
21
                       -e '/\@\@$$/s/\@\@$$/\\/'
 
22
 
 
23
# Strings to replace in man pages
 
24
XORGRELSTRING = @PACKAGE_STRING@
 
25
  XORGMANNAME = X Version 11
 
26
  XSERVERNAME = Xorg
 
27
 
 
28
MANDEFS = \
 
29
        -D__vendorversion__="\"$(XORGRELSTRING)\" \"$(XORGMANNAME)\"" \
 
30
        -D__xorgversion__="\"$(XORGRELSTRING)\" \"$(XORGMANNAME)\"" \
 
31
        -D__appmansuffix__=$(APP_MAN_SUFFIX) \
 
32
        -D__filemansuffix__=$(FILE_MAN_SUFFIX) \
 
33
        -D__libmansuffix__=$(LIB_MAN_SUFFIX) \
 
34
        -D__miscmansuffix__=$(MISC_MAN_SUFFIX) \
 
35
        -D__drivermansuffix__=$(DRIVER_MAN_SUFFIX) \
 
36
        -D__adminmansuffix__=$(ADMIN_MAN_SUFFIX) \
 
37
        -D__projectroot__=$(prefix) \
 
38
        -D__xconfigfile__=$(__XCONFIGFILE__) -D__xconfigdir__=$(XCONFIGDIR) \
 
39
        -D__xlogfile__=$(XLOGFILE) -D__xservername__=$(XSERVERNAME) 
 
40
 
 
41
.pre:
 
42
        $(RAWCPP) $(RAWCPPFLAGS) $(CPP_FILES_FLAGS) < $< | $(CPP_SED_MAGIC) > $@
 
43
 
 
44
.man.pre.man:
 
45
        $(RAWCPP) $(RAWCPPFLAGS) $(MANDEFS) $(EXTRAMANDEFS) < $< | $(CPP_SED_MAGIC) > $@