help-make
[Top][All Lists]
Advanced

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

Re: MAKEFLAGS (Was: forcing a rule)


From: Noel Yap
Subject: Re: MAKEFLAGS (Was: forcing a rule)
Date: Fri, 02 Apr 2004 18:09:37 -0500
User-agent: Mozilla Thunderbird 0.5 (Windows/20040212)

Boris Kolpackov wrote:

Hi Noel,


You missed the MAKEFILES portion of my email.

I haven't tried it, but I'm thinking of something like:

 # bootstrap.mk
 ifeq ($(MAKELEVEL),0)
   # re-exec make with new MAKEFLAGS
 endif


It is easy to say "re-exec make with new MAKEFLAGS. How are you
going to reliably achieve this if it's not the only code in the
makefile? What if I say

make foo.o

I don't understand what the problem is.  The "gmake self wrapper" trick deals 
with whatever target you give gmake.

Also it means that the whole makefile is going to be read before re-execution. This could be unacceptable like in my case. So the only viable solution I can see is by bloating every makefile with

if check

include rexec.make

else

#my code

endif

Are you using recursive make?  Have you read 
http://www.pcug.org.au/~millerp/rmch/recu-make-cons-harm.html?

If, for some reason you're "forced" to use recursive make, why not have:

  # bootstrap.mk
  ifeq ($(MAKELEVEL),0)
    MAKEFILES :=

    # re-exec make with new MAKEFLAGS
  endif

then set MAKEFLAGS=bootstrap.mk.

Set where? in environment? No, thank you! ;-)

One idea, from an offline thread, is to have a configuration file similar to 
CVS's .cvsrc.  One thought is to have a global configuration file that can set 
MAKEFILES.

Of course, this all depends on what sort of project you're supporting.

Noel




reply via email to

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