Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Yann E. MORIN <yann.morin.1998@free.fr>
To: buildroot@busybox.net
Subject: [Buildroot] [RFC] makefile ?= behavior
Date: Tue, 3 Dec 2013 19:23:16 +0100	[thread overview]
Message-ID: <20131203182316.GA3633@free.fr> (raw)
In-Reply-To: <OF1C1194FC.E790AAF4-ON86257C36.00633887-86257C36.00640499@rockwellcollins.com>

Matthew, All,

On 2013-12-03 12:12 -0600, Matthew Weber spake thusly:
> I'd like to make sure I'm not loosing it :-)
> 
> So I have the package smcroute(https://github.com/troglobit/smcroute) (new 
> package not yet in buildroot) and it is autotools based.  I do a configure 
> with all the toolchain info and it sets up the Makefile to have the 
> following CC definition.  This is the only location in the package 
> Makefiles that set CC.
>     CC ?= /opt/linux/linaro4.7/usr/bin/arm-linux-gnueabihf-gcc 

That's because it's not a complete autotools-based package: the
configure is from autoconf, but the Makefile is hand-written, so you
won't be able to use the autotools-package infrastructure.

Instead, use the generic-package infrastructure, and provide the
adequate CONFIGURE_CMDS, BUILD_CMDS and INSTALL_TARGET_CMDS.

> I believe that the ?= should just be a =, but in what cases would the ?= 
> actually work?  I'm trying to put the story together to convince someone 
> that believes it's just a environment issue...

?= means to assign the value if it is not already set.

When you switch to generic-package, you have those variables available
to pass to configure and make:
    TARGET_CONFIGURE_OPTS
    TARGET_MAKE_ENV

Those variables are defined in package/Makefile.in and contain the
necessary definitions for CC et al.

Regards,
Yann E. MORIN.

-- 
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 223 225 172 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'

  reply	other threads:[~2013-12-03 18:23 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-12-03  7:30 [Buildroot] [autobuild.buildroot.net] Build results for 2013-12-02 Thomas Petazzoni
2013-12-03 14:04 ` Vicente Olivert Riera
2013-12-03 14:13   ` Gustavo Zacarias
2013-12-03 14:25     ` Thomas Petazzoni
2013-12-03 18:12       ` [Buildroot] [RFC] makefile ?= behavior Matthew Weber
2013-12-03 18:23         ` Yann E. MORIN [this message]
2013-12-03 18:32           ` Matthew Weber
2013-12-03 21:55 ` [Buildroot] [autobuild.buildroot.net] Build results for 2013-12-02 Thomas Petazzoni

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20131203182316.GA3633@free.fr \
    --to=yann.morin.1998@free.fr \
    --cc=buildroot@busybox.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox