summaryrefslogtreecommitdiff
path: root/cpprules.in
diff options
context:
space:
mode:
authorAlan Coopersmith <alan.coopersmith@sun.com>2005-07-09 18:44:14 +0000
committerAlan Coopersmith <alan.coopersmith@sun.com>2005-07-09 18:44:14 +0000
commit3939ac4410446b46071c9d714f4270c12bf904fe (patch)
tree51ec855dea94ae24d7882bd8bfcc0a5b86876e30 /cpprules.in
parent19ba9d0df86c688319377467254b9ea9c4b0eccc (diff)
downloadxorg-lib-libX11-3939ac4410446b46071c9d714f4270c12bf904fe.tar.gz
- Since all but one line of all the nls/*/Makefile.am files are identical, move common bits to nls/localerules.in for easier updating and use automake includes to include in all the nls/*/Makefile.am files
- Don't assume $(CPP) can take gcc-only -traditional flag - CPP process man pages as is done in the monolithic tree
Diffstat (limited to 'cpprules.in')
-rw-r--r--cpprules.in28
1 files changed, 28 insertions, 0 deletions
diff --git a/cpprules.in b/cpprules.in
new file mode 100644
index 00000000..d0924add
--- /dev/null
+++ b/cpprules.in
@@ -0,0 +1,28 @@
+# -*- Makefile -*-
+# Rules for generating files using the C pre-processor
+# (Replaces CppFileTarget from Imake)
+
+SED = sed
+
+SUFFIXES = .pre
+
+WCHAR32_FLAGS = -DWCHAR32=@WCHAR32@
+
+CPP_FILES_FLAGS = $(WCHAR32_FLAGS)
+
+# Translate XCOMM into pound sign with sed, rather than passing -DXCOMM=XCOMM
+# to cpp, because that trick does not work on all ANSI C preprocessors.
+# Delete line numbers from the cpp output (-P is not portable, I guess).
+# Allow XCOMM to be preceded by whitespace and provide a means of generating
+# output lines with trailing backslashes.
+# Allow XHASH to always be substituted, even in cases where XCOMM isn't.
+
+CPP_SED_MAGIC = $(SED) -e '/^\# *[0-9][0-9]* *.*$$/d' \
+ -e '/^\#line *[0-9][0-9]* *.*$$/d' \
+ -e '/^[ ]*XCOMM$$/s/XCOMM/\#/' \
+ -e '/^[ ]*XCOMM[^a-zA-Z0-9_]/s/XCOMM/\#/' \
+ -e '/^[ ]*XHASH/s/XHASH/\#/' \
+ -e '/\@\@$$/s/\@\@$$/\\/'
+
+.pre:
+ $(RAWCPP) $(RAWCPPFLAGS) $(CPP_FILES_FLAGS) < $< | $(CPP_SED_MAGIC) > $@ \ No newline at end of file