On Mon, August 4, 2008 2:54 pm, Sam Ravnborg wrote:

> I played with this sample - replacing include with $(warning ...)
> and it just works.
>
> Could you please post a real example that fails
> so we can try it out.

Sure.. No problems.. Very easy to repro for me with the following.. Invoke
make using 'make release' and you *should* see :

Makefile:10: *** Mode WAS defined properly!.  Stop.

However, that is not the case w/ Make 3.81.. Below are the two Makefiles
to try this out with :

Contents of Makefile:
===================================
foo = foo
bar = bar

include Makefile-aliases.mak

ifndef mode
  mode = bar
  $(error mode NOT defined properly!)
else
  $(error Mode WAS defined properly!)
endif
===================================



Contents of Makefile-aliases.mak
===================================
.PHONY:         release
release:        all

ifneq ($(filter release,$(MAKECMDGOALS)),)
        mode    = foo
endif
===================================

Just keep in mind that the conditional above (ifndef) controls
reading a secondary Makefile in my real probkem scenario.. It appears
that it eventually sets 'mode=bar' but not in the proper time frame
for the conditionals above.. You can see this below by the output from
'make -p release | grep mode' :

Makefile:8: *** mode NOT defined properly!.  Stop.
mode = bar
        mode    = foo

It doesn't seem to matter if I used variables w/ := vs. = either.. If
there's something obvious I've missed, please let me know... Thanks!



_______________________________________________
Help-make mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/help-make

Reply via email to