Need help using /usr/lib/cpp for generic text

Mark A. Verber verber at pacific.mps.ohio-state.edu
Thu Sep 21 22:45:39 AEST 1989


I need some help using /usr/lib/cpp.  I am using cpp for the
conditionals and for it's macros.  I have a rather large document (a
Introductory Facilities Guide for Unix, Tops-20, Macintosh, and
shortly IBM-PC, and Vax/VMS).  Originally this guide was for a single
site, but I have been working hard to make it very generic.  The
intention is that any site could easily use this guide for their local
operation with minimal fuss: They would need to change some macros
(like name of the orginzation), set some flags as to what machines
they have, and edit a few files that are broken out of the rest of the
documents since we know each site will be different.

The alpha version of the document used TeX \defs and a simple ifdef
macro that I wrote.  It has become clear that this isn't enough so
I decided to move to using make and cpp.

I have run into two problems with cpp that I hope someone could help
me with. 

(1)  Bloody "# line-number file-name" lines

I had thought that the -P switch suppressed such output, but that doesn't
seem to be the case (SunOS 4.x /usr/lib/cpp).  I don't want these lines.

(2)  Leaving <cr> in the text

When I run text like:	I get the output like:		I would like:

	#define foo	before				before
	before						test
	#ifdef foo	test				after
	test
	#endif		after
	after

Any suggestions on getting cpp to eat the <cr> at the end of the control
lines?  Is there a PD cpp or other macro processor that will do the
job for me... or should I pull out ye old perl manual.

-- 
Mark A. Verber
System Programmer, Physics Department, Ohio State University
verber at pacific.mps.ohio-state.edu
(614) 292-8002



More information about the Comp.unix.wizards mailing list