%% James Amundson <[EMAIL PROTECTED]> writes:
ja> "Paul D. Smith" wrote:
>> If you'd found the right part of the GNU make manual, you could be
>> assured that it's a feature :).
ja> Thank you. I read the relevant part of the manual again. I see
ja> this behavior is well documented. I actually had read the previous
ja> two paragraphs before sending in this report. I stopped just a
ja> little too soon. I will confess to not understanding the
ja> rationale.
The rationale... behind the way "%.x %.y:" works?
It's _extremely_ handy. In fact, I consider it a failing of GNU make
that there's no way to express this same concept for explicit,
non-pattern rules. One should be added.
Consider a program that generates multiple output files, like yacc for
example. Normally you can only inform make that a program creates one
output file (target), so you either have to choose one of them to be the
"master" file and have all targets depend on that, or make a fake target
for that purpose. But, that's a drag and doesn't always work.
Consider yacc, which creates an xxx.c and an xxx.h file. You need make
to know about the .c file, because your program/library depends on the
xxx.o file and the xxx.o file can be created from the xxx.c file, so you
need to tell make how to create the xxx.c file.
Now suppose you have an automatic dependency tracking system, so you
also have some other file yyy.c which includes xxx.h; now you also have
a rule that gives xxx.h as a prerequisite of yyy.o. But if you can't
have a rule that gives xxx.h as the target, make has no way to know how
to create xxx.h.
"Normally" you can avoid this problem by just ordering the prerequisites
so you know that the xxx.c target will always be built first, thus
creating xxx.h as a side-effect.
But, what about parallel builds? In parallel builds you can't guarantee
any order at all except for those explicitly stated in the makefile, so
unless you're willing to make yyy.c depend on xxx.c or something
similar, you're possibly in trouble.
Also, what if someone says "make yyy.o" directly? Then xxx.o will never
be built.
This construct is crucial to allow make to _accurately_ understand the
behavior of some toolsets, and, as I said, I think it's a problem that
you can only do it with pattern rules and not explicit rules.
--
-------------------------------------------------------------------------------
Paul D. Smith <[EMAIL PROTECTED]> Find some GNU make tips at:
http://www.gnu.org http://www.ultranet.com/~pauld/gmake/
"Please remain calm...I may be mad, but I am a professional." --Mad Scientist