diff mbox

scripts: fix "make install" when a directory or file named install exists

Message ID CA+Y=x3k4eMMamEANrSFGcopAesMqrbQP-gcxvyXpV7SEee4hOw@mail.gmail.com (mailing list archive)
State New, archived
Headers show

Commit Message

Andrew Worsley Aug. 7, 2012, 9:08 a.m. UTC
Allow "make install" to work even if a file or directory called install exists
Signed-off-by: Andrew Worsley <amworsley@gmail.com>
---
This is based on mainline  v3.5 version. It's almost trivial except I
spent about an hour trying to install the kernel output into a
directory install/<architecture> as per other packages I build before
I realised the obvious problem! So I thought it
was worth submitting to avoid other people hitting this problem: The
target install is not marked as PHONY anywhere.

--
To unsubscribe from this list: send the line "unsubscribe linux-kbuild" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Comments

Michal Marek Aug. 30, 2012, 1:30 p.m. UTC | #1
On 7.8.2012 11:08, Andrew Worsley wrote:
> diff --git a/scripts/Makefile.build b/scripts/Makefile.build
> index ff1720d..cf4b970 100644
> --- a/scripts/Makefile.build
> +++ b/scripts/Makefile.build
> @@ -434,6 +434,7 @@ $(multi-used-m) : %.o: $(multi-objs-m) FORCE
> 
>  targets += $(multi-used-y) $(multi-used-m)
> 
> +PHONY += install
> 
>  # Descending
>  # ---------------------------------------------------------------------------

I don't think this is the right place to fix it (at least, it should be
near the .PHONY target with an explanation why it is needed). First, the
PHONY variable is usually assigned right before the target is defined.
Second, the are usually two 'install' targets: One is in
arch/$arch/Makefile, which usually invokes scripts/Makefile.build in
arch/$arch/boot, where the actual install target is defined. So this
patch only covers the arch/$arch/boot/Makefile case. It works on x86,
because arch/x86/Makefile already has the PHONY assignment and only
arch/x86/boot/Makefile is missing it. Also, not all architectures have
install, while some have more *install variants. So I'm for fixing the
Makefiles that do not yet have the PHONY += install or such.

Michal
--
To unsubscribe from this list: send the line "unsubscribe linux-kbuild" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/scripts/Makefile.build b/scripts/Makefile.build
index ff1720d..cf4b970 100644
--- a/scripts/Makefile.build
+++ b/scripts/Makefile.build
@@ -434,6 +434,7 @@  $(multi-used-m) : %.o: $(multi-objs-m) FORCE

 targets += $(multi-used-y) $(multi-used-m)

+PHONY += install

 # Descending
 # ---------------------------------------------------------------------------