Skip to contentSkip to conversation

Makefile: fix out-of-tree builds with multiple targets with 'all'

PATCH Superseded Yann E. MORIN 2 participants 3 messages Nov 3, 2013 – Nov 4, 2013

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 Makefile: fix out-of-tree builds with multiple targets with 'all'

From: "Yann E. MORIN" <[email protected]>

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.

---
Changes v1->v2:
- fix one missed 'all' occurence

---
 support/scripts/mkmakefile | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
support/scripts/mkmakefile +4 -4
index cef2ec7..27b1507 100755
@@ -32,16 +32,16 @@ MAKEFLAGS += --no-print-directory
 
 .PHONY: all \$(MAKECMDGOALS)
 
-all	:= \$(filter-out all Makefile,\$(MAKECMDGOALS))
+all	:= \$(filter-out Makefile,\$(MAKECMDGOALS))
 
-all:
+_all:
 	\$(MAKE) \$(MAKEARGS) \$(all)
 
 Makefile:;
 
-\$(all): all
+\$(all): _all
 	@:
 
-%/: all
+%/: _all
 	@:
 EOF
Signature · 1 line
1.8.1.2
#1 lore raw

PATCH v2 1/1 Makefile: fix out-of-tree builds with multiple targets with 'all'

Yann,

"Yann E. MORIN" <[email protected]> wrote on 11/03/2013 04:23:01 AM:

Quoted 5 lines

From: "Yann E. MORIN" <[email protected]>

For out-of-tree builds, this use-case fails to build:

    $ make clean all
Quoted 8 lines

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.

Could you please add a comment about fixing the bug I reported? I'll even make it easy for you with having the comment below so you can copy and paste :)

Fixes bug #6644

If you add the comment above, I will give you this:

Quoted 7 lines

---
Changes v1->v2:
- fix one missed 'all' occurence

#2 lore raw

PATCH v2 1/1 Makefile: fix out-of-tree builds with multiple targets with 'all'

Ryan, All,

On 2013-11-04 08:18 -0600, Ryan Barnett spake thusly:

Quoted 17 lines

Yann,

"Yann E. MORIN" <[email protected]> wrote on 11/03/2013 04:23:01 AM:

Quoted 12 lines

From: "Yann E. MORIN" <[email protected]>

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.

Quoted 7 lines
Quoted 1 line

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

Could you please add a comment about fixing the bug I reported? I'll even make it easy for you with having the comment below so you can copy and paste :)

Fixes bug #6644

Doh, yes, I'll repost with commit message fixed.

Quoted 3 lines

If you add the comment above, I will give you this:

Thanks!

Regards,
Yann E. MORIN.

Signature · 6 lines
.-----------------.--------------------.------------------.--------------------.
|  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.  |
'------------------------------^-------^------------------^--------------------'