[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: make undefined $(MY_VARIABLE) usage query
From: |
Jon Grant |
Subject: |
Re: make undefined $(MY_VARIABLE) usage query |
Date: |
Fri, 4 Dec 2009 13:48:28 +0000 |
2009/12/4 Paul Smith <address@hidden>:
> On Fri, 2009-12-04 at 11:00 +0000, Jon Grant wrote:
>> I looked through the manual (3.81) and could not find a way to get GNU
>> Make to display an error, or warning when a variable is used without
>> being defined. like $(MY_VARIABLE)
>
> Not sure where you were looking, but the best place to start is the
> "Summary of Options" section in the manual.
>
> Look there for the --warn-undefined-variables option.
(Just to declare, I am using the Cygwin build)
I noticed that if I add the additional parameter to our MAKEFLAGS, and
misspell it, the -debug mode seems to get enabled. Is this intended? I
had expected invalid parameters to be warned, and ignored.
MAKEFLAGS := --no-print-directory
MAKEFLAGS := -warn-undefined-variables
export MAKEFLAGS
output is lots of:
Considering target file `makefile'.
Looking for an implicit rule for `makefile'.
No implicit rule found for `makefile'.
Finished prerequisites of target file `makefile'.
No need to remake target `makefile'.
Updating goal targets....
Considering target file `all'.
File `all' does not exist.
Looking for an implicit rule for `all'.
No implicit rule found for `all'.
Considering target file `/cygdrive/c/samples/dir.lib'.
Considering target file `obj/utf8.o'.
Best regards, Jon