[lkml]   [2013]   [Nov]   [3]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
Patch in this message
Subject[PATCH] Makefile: fix out-of-tree builds for multiple targets with 'all'
From: "Yann E. MORIN" <>

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 <>
Signed-off-by: "Yann E. MORIN" <>
Cc: Ryan Barnett <>

Note: this still does not allow 'make menuconfig all', but that is not
even working for in-tree builds either.
scripts/mkmakefile | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/scripts/mkmakefile b/scripts/mkmakefile
index 0cc0442..28583bc 100644
--- a/scripts/mkmakefile
+++ b/scripts/mkmakefile
@@ -42,18 +42,18 @@ MAKEARGS += O=\$(if \$(patsubst /%,,\$(makedir)),\$(CURDIR)/)\$(patsubst %/,%,\$

MAKEFLAGS += --no-print-directory


-all := \$(filter-out all Makefile,\$(MAKECMDGOALS))
+all := \$(filter-out Makefile,\$(MAKECMDGOALS))

\$(Q)\$(MAKE) \$(MAKEARGS) \$(all)


-\$(all): all
+\$(all): _all

-%/: all
+%/: _all

 \ /
  Last update: 2013-11-03 12:41    [W:0.040 / U:0.840 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site