Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] RFC dependencies: checking minimum make version
@ 2011-12-01 11:49 Thomas De Schampheleire
  2011-12-01 19:07 ` Peter Korsgaard
  0 siblings, 1 reply; 4+ messages in thread
From: Thomas De Schampheleire @ 2011-12-01 11:49 UTC (permalink / raw)
  To: buildroot

Hi,

The buildroot Makefile uses constructs like:

ifeq ($(BR2_TOOLCHAIN_BUILDROOT),y)
include toolchain/toolchain-buildroot.mk
else ifeq ($(BR2_TOOLCHAIN_EXTERNAL),y)
include toolchain/toolchain-external.mk
else ifeq ($(BR2_TOOLCHAIN_CTNG),y)
include toolchain/toolchain-crosstool-ng.mk
endif

which is supported from 3.81 onwards.
This means that make 3.80 will give a syntax error, even though the
toolchain/dependencies/dependencies.sh checks for minimal make version
(in fact, this script never gets a chance to run).

To fix this, and detect old make versions gracefully, I see following solutions:
1. Adapt our Makefiles to be make 3.80 compatible, by e.g. adapting
the above construct. This is not a waterproof solution, as a similar
but different problem may arise in the future.

2. Check for the make version in make instead of in shell, e.g. with
the following pattern: (adopted from
http://www.jgc.org/blog/cookbook-sample.pdf)
need := 3.81
ok := $(filter $(need),$(firstword $(sort $(MAKE_VERSION) $(need))))
ifeq (,$(ok))
$(error make too old!)
endif

This will not work when make 10.x comes out because of the sort trick,
but otherwise should work fine. This code should be included as early
as possible in the Makefile.


What do you think?

Thanks,
Thomas

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

end of thread, other threads:[~2011-12-02  8:29 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-12-01 11:49 [Buildroot] RFC dependencies: checking minimum make version Thomas De Schampheleire
2011-12-01 19:07 ` Peter Korsgaard
2011-12-02  7:56   ` Thomas De Schampheleire
2011-12-02  8:29     ` Peter Korsgaard

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