Am Die, 2002-05-07 um 10.26 schrieb Alex Hornby: > On Mon, 2002-05-06 at 06:30, Tom Tromey wrote: > > Nowadays we could probably implement pattern rules purely in automake. > > Back in the old days we didn't have the machinery to allow this. > > Automake itself was too primitive. But now it would be more possible, > > if someone were motivated. Maybe this would help with the > > longstanding CORBA problems? > > > > Tom > > Hi Tom, > > Certainly would. The problem I had with suffix rules, was that one > invocation of the idl compiler on one .idl file expands into many .h and > .cpp files, therefore I needed a suffix rule for each product. So far so > good, but when I do a parallel build the rules then race each other and > overwrite each others products (as the compiler always writes all > files), which can be bad if the compiler is reading one of those files > at the time.. > > My solution is to wrap a locking script around the suffix rules so that > any one .idl file only has the idl compiler run on it once. > > I guess if automake was to do the pattern->suffix rule conversion itself > it would ship with such a script (in a similar way to the packaging of > depcomp etc), and use it to protect the generated rules against parallel > builds. An alternative approach could be (I have no clue about CORBA) to implement a stamp-file mechanism encapsulated into suffix-rules.
I.e. to let all generated sources depend on this stamp file instead of the original source file they are generated from and to let generation of the stamp-file generate the sources as side-effects of generating the stamp-file. (A similar approach is applied to generating *infos from *.texi) Ralf