help-make
[Top][All Lists]
Advanced

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

Problem with conditional target-specific variables...


From: Bill Westfield
Subject: Problem with conditional target-specific variables...
Date: Sat, 21 Jun 2014 21:24:09 -0700

I'm having a problem using conditional target-specific variables in what I
thought was a relatively simple and obvious way.
I've condensed the problem down to this trivial example:
#---------  Makefile ---------
CFLAGS = -c -DF_CPU=$(AVR_FREQ)

foo.o:  AVR_FREQ ?= 16000000
#-------- End of Makefile ------

On various flavors of linux (I tested on ubuntu12, it's also be reported on
Suse), attempting to specify the variable on the Make command line results
in the expansion containing "random" characters (sometimes blank, sometimes
non-printable garbage characters.)  Just like "make AVR_FREQ=1000 foo.o"

On MacOSX it works fine.  I've attached two log files.  (Make 3.81 on both,
BTW.)

Any ideas what could be wrong?  There are a couple of bugs reported against
target-specific variables, but they're more complex situations and I can't
tell whether they are the same thing (and why does it work on MacOS?)

Any idea for a workaround that will accomplish the same thing?  (for make
3.81; that what the target audience has got.)
(the idea is that there are several targets with different default values
of AVR_FREQ, but each could be overridden from the command line.)

Thanks
WestfW

Attachment: make-bug-macos.txt
Description: Text document

Attachment: make-bug-ubuntu.txt
Description: Text document


reply via email to

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