%% Maciej Walezak <[EMAIL PROTECTED]> writes:
mw> all: foo.h foo.o sth.h sth.o junk.h ...
mw> foo.h foo.o: bar.h junk.h sth.h bar.o junk.o sth.o
mw> command-to-build-packet foo
This rule is not what you want. Multiple targets is identical to
writing the same rule multiple times, it does _NOT_ mean that running
that command once will create all the targets. In other words, the
above command is identical to this:
foo.h: bar.h junk.h sth.h bar.o junk.o sth.o
command-to-build-packet foo
foo.o: bar.h junk.h sth.h bar.o junk.o sth.o
command-to-build-packet foo
That's not what you want: you want to tell make that it only needs to
run the rule once to build both targets. You do that with a
multi-target pattern rule, like this:
%.h %.o: %
command-to-build-packet $*
(I don't know what the dependency should be: your rules don't seem to
show what the command builds the packet _from_), then this:
foo.h foo.o: bar.h junk.h sth.h bar.o junk.o sth.o
(with no command script).
--
-------------------------------------------------------------------------------
Paul D. Smith <[EMAIL PROTECTED]> Find some GNU make tips at:
http://www.gnu.org http://www.paulandlesley.org/gmake/
"Please remain calm...I may be mad, but I am a professional." --Mad Scientist
_______________________________________________
Help-make mailing list
[EMAIL PROTECTED]
http://mail.gnu.org/mailman/listinfo/help-make