Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!ucbvax!agate!labrea!decwrl!megatest!djones From: djones@megatest.UUCP (Dave Jones) Newsgroups: comp.lang.c Subject: Re: Cake (was Recursive #includes) Message-ID: <2712@goofy.megatest.UUCP> Date: 3 Mar 89 21:30:52 GMT References: <20078@santra.UUCP> Organization: Megatest Corporation, San Jose, Ca Lines: 65 From article <20078@santra.UUCP>, by alo@kampi.hut.fi (Antti Louko): > > When I saw cake first time, it seemed just fine. But after a while I > realized one thing. After that I haven't used cake anymore. > > Lets have an Cakefile: > > $ cat Cakefile > vax: /dev/null > cp /dev/null vax > > $ cake > cp /dev/null 1 > $ > > Funny, uh? If you have a SUN, replace "vax" with "sun". > I gave up on cake also, but for different reasons.. I was trying to use it to keep up with making sub-files: specifically, entries in an archive.a. I never did get it to work. Finally decided that I was understanding things correctly, but cake was broke. Anyhow.. The example you gave demonstrates a problem with cpp, and cake runs its input through cpp. Try compiling the following C one-liner on your vax: int vax; I will not compile, because cpp translates it into int 1; "vax" is predefined by cpp to be "1". Oh well. The reason they define sun, or vax, or whatever, is for those #ifdef thingies, like #ifdef sun some silly code #else some other silly code #endif sun I can't think of any way to do it better, without drasticly changing the way cpp works. What's needed is some way to limit the scope of #defines, so that the above could be done something like this: #with # ifdef sun some silly code # else some other silly code # endif sun #endwith int sun; But cpp was not specked very well to begin with, and now we are pretty much stuck with it the way it is.