[Top][All Lists]

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

Re: curious behaviour of $MAKEFLAGS and leading hyphen

From: Paul D. Smith
Subject: Re: curious behaviour of $MAKEFLAGS and leading hyphen
Date: Fri, 22 Apr 2005 09:01:26 -0400

%% "Robert P. J. Day" <address@hidden> writes:

  rpjd> MAKEFLAGS would, when calling a subshell, be set to "I /tmp" and, i'm
  rpjd> assuming, the callee would then use "-${MAKEFLAGS}", right?

No.  You should NEVER use MAKEFLAGS in a command line.  It's completely
inappropriate to do so and will break your make process in some

MAKEFLAGS is and has always been intended to be passed THROUGH THE
ENVIRONMENT, not on the command line.  You should set MAKEFLAGS in the
environment, and add to it or reset it in the makefile, but you should
never use it explicitly in a command line.

  rpjd> but how to explain "make -j 5" then and what it does with
  rpjd> MAKEFLAGS?

  rpjd>         MAKEFLAGS =  --jobserver-fds=3,4 -j

  rpjd> ???.  this seems inconsistent with the normal MAKEFLAGS
  rpjd> behaviour WRT to that leading hyphen.  thoughts?

My thought is that, as above, MAKEFLAGS is the responsibility of the
make program to manage, although you can add to it with += etc.  But
it's up to make to pass it around through recursion and to interpret it,
and as such as long as it works for that, it's fine.

 Paul D. Smith <address@hidden>          Find some GNU make tips at:            
 "Please remain calm...I may be mad, but I am a professional." --Mad Scientist

reply via email to

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