initial commit
[profile/ivi/xorg-x11-xinit.git] / cpprules.in
1 # Translate XCOMM into pound sign with sed, rather than passing -DXCOMM=XCOMM
2 # to cpp, because that trick does not work on all ANSI C preprocessors.
3 # Delete line numbers from the cpp output (-P is not portable, I guess).
4 # Allow XCOMM to be preceded by whitespace and provide a means of generating
5 # output lines with trailing backslashes.
6 # Allow XHASH to always be substituted, even in cases where XCOMM isn't.
7
8 CPP_SED_MAGIC = $(SED) -e '/^\#  *[0-9][0-9]*  *.*$$/d' \
9                        -e '/^\#line  *[0-9][0-9]*  *.*$$/d' \
10                        -e '/^[  ]*XCOMM$$/s/XCOMM/\#/' \
11                        -e '/^[  ]*XCOMM[^a-zA-Z0-9_]/s/XCOMM/\#/' \
12                        -e '/^[  ]*XHASH/s/XHASH/\#/' \
13                        -e '/XSLASHGLOB/s/XSLASHGLOB/\/\*/' \
14                        -e '/\@\@$$/s/\@\@$$/\\/'
15
16 # Strings to replace in man pages
17 XORGRELSTRING = @PACKAGE_STRING@
18   XORGMANNAME = X Version 11
19
20 MANDEFS =  \
21         -D__xorgversion__="\"$(XORGRELSTRING)\" \"$(XORGMANNAME)\"" \
22         -D__appmansuffix__=$(APP_MAN_SUFFIX) \
23         -D__filemansuffix__=$(FILE_MAN_SUFFIX) \
24         -D__libmansuffix__=$(LIB_MAN_SUFFIX) \
25         -D__miscmansuffix__=$(MISC_MAN_SUFFIX) \
26         -D__XSERVERNAME__=Xorg -D__XCONFIGFILE__=xorg.conf \
27         -D__xinitdir__=$(XINITDIR) \
28         -D__bindir__=$(bindir) \
29         -DSHELL_CMD=$(SHELL_CMD) $(ARCHMANDEFS)
30
31 SUFFIXES = .$(APP_MAN_SUFFIX) .man .cpp
32
33 .cpp:
34         $(RAWCPP) $(RAWCPPFLAGS) $(CPP_FILES_FLAGS) < $< | $(CPP_SED_MAGIC) > $@
35
36 .man.$(APP_MAN_SUFFIX):
37         $(RAWCPP) $(RAWCPPFLAGS) $(MANDEFS) $(EXTRAMANDEFS) < $< | $(CPP_SED_MAGIC) > $@