2 # Rules for generating files using the C pre-processor
3 # (Replaces CppFileTarget from Imake)
9 WCHAR32_FLAGS = -DWCHAR32=@WCHAR32@
11 CPP_FILES_FLAGS = $(WCHAR32_FLAGS)
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.
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/\@\@$$/\\/'
30 $(AM_V_GEN)$(RAWCPP) $(RAWCPPFLAGS) $(CPP_FILES_FLAGS) < $< | $(CPP_SED_MAGIC) > $@