Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] Which order: $(MAKE) $(TARGET_CONFIGURE_OPTS) or $(TARGET_CONFIGURE_OPTS) $(MAKE)
@ 2017-03-29 17:58 Thomas De Schampheleire
  2017-03-29 19:35 ` Thomas Petazzoni
  0 siblings, 1 reply; 5+ messages in thread
From: Thomas De Schampheleire @ 2017-03-29 17:58 UTC (permalink / raw)
  To: buildroot

Hi,

In package makefiles, you can find both uses:

    $(MAKE) $(TARGET_CONFIGURE_OPTS)
versus
    $(TARGET_CONFIGURE_OPTS) $(MAKE)

and likewise for host packages:

    $(MAKE) $(HOST_CONFIGURE_OPTS)
versus
    $(HOST_CONFIGURE_OPTS) $(MAKE)


The order matters because it has impact on the precedence rules of make.
In the case where $(MAKE) is present first, the variables are passed
as make variables, which have precedence over variables explicitly
defined in the makefiles.
However, if $(MAKE) is _after_ the variable list, then the variables
are treated as environment variables. In make, environment variables
are directly readable as make variables, but an explicit assignment to
such variable overwrites the value passed via the environment, unless
the assignment is done conditionally, e.g. with ?= instead of = / :=.

Given this, if you want to make sure that the value you give is taken
into account, the forms:

    $(MAKE) $(TARGET_CONFIGURE_OPTS)
    $(MAKE) $(HOST_CONFIGURE_OPTS)

should be used.

Do you agree with this analysis?
If so, there is a cleanup opportunity for motivated developers :-)

Thanks,
Thomas

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2017-03-30 22:33 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-03-29 17:58 [Buildroot] Which order: $(MAKE) $(TARGET_CONFIGURE_OPTS) or $(TARGET_CONFIGURE_OPTS) $(MAKE) Thomas De Schampheleire
2017-03-29 19:35 ` Thomas Petazzoni
2017-03-29 19:43   ` Thomas De Schampheleire
2017-03-29 19:49     ` Thomas Petazzoni
2017-03-30 22:33       ` Arnout Vandecappelle

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox