diff mbox series

kbuild: fix warning "overriding recipe for target 'Makefile'"

Message ID 1553581936-6476-1-git-send-email-yamada.masahiro@socionext.com (mailing list archive)
State New, archived
Headers show
Series kbuild: fix warning "overriding recipe for target 'Makefile'" | expand

Commit Message

Masahiro Yamada March 26, 2019, 6:32 a.m. UTC
If you do "make Makefile" with GNU Make 3.x, the following warning
is displayed:

  $ make Makefile
  Makefile:165: warning: overriding recipe for target 'Makefile'
  Makefile:51: warning: ignoring old recipe for target 'Makefile'
  make[1]: Nothing to be done for 'Makefile'.
  make: Nothing to be done for 'Makefile'.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
---

 Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Masahiro Yamada March 30, 2019, 5:12 a.m. UTC | #1
On Tue, Mar 26, 2019 at 3:46 PM Masahiro Yamada
<yamada.masahiro@socionext.com> wrote:
>
> If you do "make Makefile" with GNU Make 3.x, the following warning
> is displayed:
>
>   $ make Makefile
>   Makefile:165: warning: overriding recipe for target 'Makefile'
>   Makefile:51: warning: ignoring old recipe for target 'Makefile'
>   make[1]: Nothing to be done for 'Makefile'.
>   make: Nothing to be done for 'Makefile'.
>
> Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
> ---

Applied to linux-kbuild.



>
>  Makefile | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/Makefile b/Makefile
> index 70fc778..1b361bd 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -161,7 +161,7 @@ ifeq ($(need-sub-make),1)
>
>  PHONY += $(MAKECMDGOALS) sub-make
>
> -$(filter-out _all sub-make $(CURDIR)/Makefile, $(MAKECMDGOALS)) _all: sub-make
> +$(filter-out _all sub-make $(lastword $(MAKEFILE_LIST)), $(MAKECMDGOALS)) _all: sub-make
>         @:
>
>  # Invoke a second make in the output directory, passing relevant variables
> --
> 2.7.4
>
diff mbox series

Patch

diff --git a/Makefile b/Makefile
index 70fc778..1b361bd 100644
--- a/Makefile
+++ b/Makefile
@@ -161,7 +161,7 @@  ifeq ($(need-sub-make),1)
 
 PHONY += $(MAKECMDGOALS) sub-make
 
-$(filter-out _all sub-make $(CURDIR)/Makefile, $(MAKECMDGOALS)) _all: sub-make
+$(filter-out _all sub-make $(lastword $(MAKEFILE_LIST)), $(MAKECMDGOALS)) _all: sub-make
 	@:
 
 # Invoke a second make in the output directory, passing relevant variables