Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!uunet!samsung!uakari.primate.wisc.edu!bin From: bin@primate.wisc.edu (Brain in Neutral) Newsgroups: comp.windows.x Subject: Re: R5 and Imake Message-ID: <2910@uakari.primate.wisc.edu> Date: 10 Aug 90 18:09:23 GMT References: <1767@idunno.Princeton.EDU> Sender: bin@primate.wisc.edu Reply-To: bin@primate.wisc.edu Lines: 33 From article <1767@idunno.Princeton.EDU>, by rhl@grendel.Princeton.EDU (Robert Lupton (the Good)): > > The more I learn about Imake the more times I come across admissions > that things are made extra-specially-convoluted to avoid unhappy habits > of cpp. > ... > I'd volunteer, except that I'm not that familiar with imake... Maybe > another fun project for poor Paul DuBois? Well, one of the things cpp is used for in X is to create scripts from template files. It seems that the use of cpp in those instances is mainly to substitute into the template the values of certain make variables, e.g., like a library directory into a shell script. As you've noted, there are certain problems with this. As I would put it, the main ones are: (1) cpp modifies its source besides symbol substitution, e.g., lines beginning with ``#'' are special and comments (``/* ... */'') are deleted. (2) it is necessary to pass a -D flag for every symbol to be substituted. This can make for very long rule invocations in your Imakefile. Hard to read and subject to error. And it's simply a pain to have to explicitly list every symbol you want to substitute. Why not read the Makefile directly, yank out the variable values, look for instances of $(varname) or ${varname) in the template, and substitute the values - and leave everything else alone? That's why I wrote msub. Mail me if you're interested. Paul DuBois dubois@primate.wisc.edu