[Buildroot] [PATCH] Makefile: fix out-of-tree builds with multiple targets with 'all'

Yann E. MORIN yann.morin.1998 at free.fr
Sun Nov 3 10:18:22 UTC 2013

From: "Yann E. MORIN" <yann.morin.1998 at free.fr>

For out-of-tree builds, this use-case fails to build:
    $ make clean all

This is because 'all' is filtered-out in the Makefile wrapper, since
the wrapper itself has a 'all' target.

The 'all' target is just the usual naming for the default target in a
Makefile. In fact, the first target is the default one, so we can name
it whatever we want.

Rename the Makefile wrapper 'all' target to avoid name-clashing.

Reported-by: Ryan Barnett <rjbarnet at rockwellcollins.com>
Signed-off-by: "Yann E. MORIN" <yann.morin.1998 at free.fr>
Cc: Ryan Barnett <rjbarnet at rockwellcollins.com>
 support/scripts/mkmakefile | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/support/scripts/mkmakefile b/support/scripts/mkmakefile
index cef2ec7..89dc649 100755
--- a/support/scripts/mkmakefile
+++ b/support/scripts/mkmakefile
@@ -32,14 +32,14 @@ MAKEFLAGS += --no-print-directory
-all	:= \$(filter-out all Makefile,\$(MAKECMDGOALS))
+all	:= \$(filter-out Makefile,\$(MAKECMDGOALS))
 	\$(MAKE) \$(MAKEARGS) \$(all)
-\$(all): all
+\$(all): _all
 %/: all

More information about the buildroot mailing list