help-make
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

"hidden" targets


From: Jonathan Baccash
Subject: "hidden" targets
Date: Tue, 22 Mar 2005 15:08:22 -0800

What is the best way to handle a command that creates more than one target?  After reading “The trouble with hidden targets” at http://www.electric-cloud.com/resources/ I get the feeling the advice is “don’t use them”.  But in reality, this is not possible.  Some compiler commands create multiple outputs.

 

For example, for the arguments I pass, the Visual C++ cl compiler will create a $*.obj and a $*.sbr.  The way I handle this is I tell make that the output is really $*.obj, and whenever a rule depends on $*.sbr, I tell make that it depends on $*.obj, and I use a patsubst in that rule’s command if necessary.

 

Is there a better way to do this?  Could some sort of make syntax be added to tell make that a particular command creates multiple targets?  This might get hairy, since there could be commands that create just %.sbr, and there could be other commands that create just %.obj, but if you need both, it’s best to do them both at once because it’s faster.  There are examples of this on UNIX as well, i.e. creating .o and .d files.

 

Jon.

 


************************************************************************ If you have received this e-mail in error, please delete it and notify the sender as soon as possible. The contents of this e-mail may be confidential and the unauthorized use, copying, or dissemination of it and any attachments to it, is prohibited. Internet communications are not secure and Hyperion does not, therefore, accept legal responsibility for the contents of this message nor for any damage caused by viruses. The views expressed here do not necessarily represent those of Hyperion. For more information about Hyperion, please visit our Web site at www.hyperion.com

reply via email to

[Prev in Thread] Current Thread [Next in Thread]