2 # Rules for generating files using the C pre-processor
3 # (Replaces CppFileTarget from Imake)
7 SUFFIXES = .pre .man .man.pre
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.
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/\@\@$$/\\/'
23 # Strings to replace in man pages
24 XORGRELSTRING = @PACKAGE_STRING@
25 XORGMANNAME = X Version 11
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__mandir__=$(mandir) \
38 -D__projectroot__=$(prefix) \
39 -D__xconfigfile__=$(__XCONFIGFILE__) -D__xconfigdir__=$(XCONFIGDIR) \
40 -D__xlogfile__=$(XLOGFILE) -D__xservername__=$(XSERVERNAME)
43 $(RAWCPP) $(RAWCPPFLAGS) $(CPP_FILES_FLAGS) < $< | $(CPP_SED_MAGIC) > $@
46 $(RAWCPP) $(RAWCPPFLAGS) $(MANDEFS) $(EXTRAMANDEFS) < $< | $(CPP_SED_MAGIC) > $@