[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Rd: Using the same options for compiling and linking
From: |
Mark Galeck |
Subject: |
Re: Rd: Using the same options for compiling and linking |
Date: |
Tue, 7 May 2013 14:16:02 -0700 (PDT) |
>
> Assigning to MAKEFLAGS only affects sub-makes, despite this (wrong)
> paragraph from the documentation:
>
> MAKEFLAGS
> The flags given to make. You can set this in the environment
> or a makefile to set flags. See Communicating Options to a
I disagree that this paragraph is wrong. You can set MAKEFLAGS in the
environment or makefile. The meaning of "MAKEFLAGS" from the manual is this:
MAKEFLAGS (...) variable is set up automatically by make to contain the flag
letters that make received. (...)
As a consequence, every sub-make gets a value for MAKEFLAGS in its environment.
(...)
The MAKEFLAGS variable can also be useful if you want to have certain options,
such as â-kâ (see Summary of Options), set each time you run make. You simply
put a value for MAKEFLAGS in your environment. You can also set MAKEFLAGS in a
makefile, to specify additional flags that should also be in effect for that
makefile.
So, you can assign MAKEFLAGS in a makefile, and the flags will be in effect
"for
that makefile", meaning - for the recursive sub-make calls that appear in that
makefile. The manual never says that the variable MAKEFLAGS has anything to do
with the same makefile or makefile call where it is parsed. It is used for
recursive calls.