%% "Jonathan Baccash" <[EMAIL PROTECTED]> writes:

  jb> What is the best way to handle a command that creates more than
  jb> one target?  After reading "The trouble with hidden targets" at
  jb> http://www.electric-cloud.com/resources/ I get the feeling the
  jb> advice is "don't use them".

If you write a pattern rule with multiple patterns on the left side, it
does exactly what you want.  WARNING!  If you do this make will assume
that the rule ALWAYS creates BOTH files.  There is no way in make to
specify that it might create either one OR the other OR both.

    %.obj %.sbr: %.cc
            ...

If you can't write a pattern rule you're out of luck: there's no similar
syntax for explicit rules.  In this case you have to use something like
this to get 100% correct behavior:

    foo.o foo.sbr: foo.XX

    foo.XX: foo.c
            ...
            @touch foo.XX

-- 
-------------------------------------------------------------------------------
 Paul D. Smith <[EMAIL PROTECTED]>          Find some GNU make tips at:
 http://www.gnu.org                      http://make.paulandlesley.org
 "Please remain calm...I may be mad, but I am a professional." --Mad Scientist


_______________________________________________
Help-make mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/help-make

Reply via email to