help-make
[Top][All Lists]
Advanced

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

Multiple invocations of GnuMake


From: Tobias Contreras
Subject: Multiple invocations of GnuMake
Date: Thu, 29 Jun 2006 10:22:47 -0400

 

 


From: Tobias Contreras
Sent: June 29, 2006 10:22 AM
To: 'address@hidden'
Subject: Multiple invocations of GnuMake

 

I need to generate both product.mak and later, a dependency file.  The dependency file requires GnuMake to have included the defines from product.mak (these affect dependencies).  GnuMake’s behaviour for handling self-generated include files is to realize the file is required, execute the rule to create it, and then restart the script from scratch.  If I use one pass, product.mak is generated and then the dependency file is generated, satisfying their interdependence.  Only then does GnuMake restart from scratch, at which point it has created both files.  The problem is that the dependencies were created before product.mak was included.  Hence, the platform-specific defines weren’t in place.  To get the job done in a single GnuMake call, we’d need a way to instruct GnuMake to restart after creating any one given include file. 

 

So how can I make something like this work in one pass instead of two? Using 3.79.1

###

defines1.mak:

           echo Generating $@

           echo DEFINES_1_INCLUDED = TRUE > defines1.mak

 

include defines1.mak

 

defines2.mak: defines1.mak

           echo Generating $@

ifdef DEFINES_1_INCLUDED

           echo DEFINES_2_INCLUDED = TRUE > defines2.mak

else

           echo DEFINES_2_BAD = TRUE > defines2.mak

endif

 

include defines2.mak

 

default: defines2.mak defines1.mak

ifdef DEFINES_2_INCLUDED

           echo Test passed!!!

else

           echo Test failed. Boo.

Endif

###

(Multiple calls to make seems to be the popular solution) 

 

Thanks once again for your help

I know you must be busy with so many questions, I resent jic

 

Tobias Contreras

Coop Tool Developer


This transmission (including any attachments) may contain confidential information, privileged material (including material protected by the solicitor-client or other applicable privileges), or constitute non-public information. Any use of this information by anyone other than the intended recipient is prohibited. If you have received this transmission in error, please immediately reply to the sender and delete this information from your system. Use, dissemination, distribution, or reproduction of this transmission by unintended recipients is not authorized and may be unlawful.

reply via email to

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