Xlib/XCB: passing the error in xreply to the extension who sent the request.
[platform/upstream/libX11.git] / cpprules.in
1 #                                                       -*- Makefile -*-
2 # Rules for generating files using the C pre-processor
3 # (Replaces CppFileTarget from Imake)
4
5 SED = LC_CTYPE=C sed
6
7 SUFFIXES += .pre
8
9 WCHAR32_FLAGS = -DWCHAR32=@WCHAR32@
10
11 CPP_FILES_FLAGS = $(WCHAR32_FLAGS)
12
13 # Translate XCOMM into pound sign with sed, rather than passing -DXCOMM=XCOMM
14 # to cpp, because that trick does not work on all ANSI C preprocessors.
15 # Delete line numbers from the cpp output (-P is not portable, I guess).
16 # Allow XCOMM to be preceded by whitespace and provide a means of generating
17 # output lines with trailing backslashes.
18 # Allow XHASH to always be substituted, even in cases where XCOMM isn't.
19
20 CPP_SED_MAGIC = $(SED) -e '/^\#  *[0-9][0-9]*  *.*$$/d' \
21                        -e '/^\#line  *[0-9][0-9]*  *.*$$/d' \
22                        -e '/^[         ]*XCOMM$$/s/XCOMM/\#/' \
23                        -e '/^[         ]*XCOMM[^a-zA-Z0-9_]/s/XCOMM/\#/' \
24                        -e '/^[         ]*XHASH/s/XHASH/\#/' \
25                        -e 's,X11_LOCALEDATADIR,$(X11_LOCALEDATADIR),g' \
26                        -e '/\@\@$$/s/\@\@$$/\\/'
27
28 .pre:
29         @$(MKDIR_P) $(@D)
30         $(AM_V_GEN)$(RAWCPP) $(RAWCPPFLAGS) $(CPP_FILES_FLAGS) < $< | $(CPP_SED_MAGIC) > $@