diff mbox

kbuild: drop FORCE from PHONY targets

Message ID 1457828035-30584-1-git-send-email-yamada.masahiro@socionext.com (mailing list archive)
State New, archived
Headers show

Commit Message

Masahiro Yamada March 13, 2016, 12:13 a.m. UTC
These targets are marked as PHONY.  No need to add FORCE to their
dependency.

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

 Makefile                     | 8 ++++----
 arch/arm/vdso/Makefile       | 2 +-
 arch/ia64/Makefile           | 4 ++--
 arch/x86/entry/vdso/Makefile | 4 ++--
 4 files changed, 9 insertions(+), 9 deletions(-)

Comments

Andy Lutomirski March 14, 2016, 12:39 a.m. UTC | #1
On Mar 12, 2016 4:14 PM, "Masahiro Yamada"
<yamada.masahiro@socionext.com> wrote:
>
> These targets are marked as PHONY.  No need to add FORCE to their
> dependency.

If this is, in fact, correct, can you update
Documentation/kbuild/makefiles.txt as well?

Thanks,
Andy
--
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
Masahiro Yamada March 14, 2016, 4:08 a.m. UTC | #2
Hi Andy

2016-03-14 9:39 GMT+09:00 Andy Lutomirski <luto@amacapital.net>:
> On Mar 12, 2016 4:14 PM, "Masahiro Yamada"
> <yamada.masahiro@socionext.com> wrote:
>>
>> These targets are marked as PHONY.  No need to add FORCE to their
>> dependency.
>
> If this is, in fact, correct, can you update
> Documentation/kbuild/makefiles.txt as well?

Which line do you want me to update?
Andy Lutomirski March 14, 2016, 4:28 a.m. UTC | #3
On Sun, Mar 13, 2016 at 9:08 PM, Masahiro Yamada
<yamada.masahiro@socionext.com> wrote:
>
> Hi Andy
>
> 2016-03-14 9:39 GMT+09:00 Andy Lutomirski <luto@amacapital.net>:
> > On Mar 12, 2016 4:14 PM, "Masahiro Yamada"
> > <yamada.masahiro@socionext.com> wrote:
> >>
> >> These targets are marked as PHONY.  No need to add FORCE to their
> >> dependency.
> >
> > If this is, in fact, correct, can you update
> > Documentation/kbuild/makefiles.txt as well?
>
> Which line do you want me to update?
>

All the references to FORCE should probably mention .PHONY as an alternative.

--Andy

>
>
>
>
> --
> Best Regards
> Masahiro Yamada
Masahiro Yamada March 14, 2016, 4:36 a.m. UTC | #4
2016-03-14 13:28 GMT+09:00 Andy Lutomirski <luto@amacapital.net>:
> On Sun, Mar 13, 2016 at 9:08 PM, Masahiro Yamada
> <yamada.masahiro@socionext.com> wrote:
>>
>> Hi Andy
>>
>> 2016-03-14 9:39 GMT+09:00 Andy Lutomirski <luto@amacapital.net>:
>> > On Mar 12, 2016 4:14 PM, "Masahiro Yamada"
>> > <yamada.masahiro@socionext.com> wrote:
>> >>
>> >> These targets are marked as PHONY.  No need to add FORCE to their
>> >> dependency.
>> >
>> > If this is, in fact, correct, can you update
>> > Documentation/kbuild/makefiles.txt as well?
>>
>> Which line do you want me to update?
>>
>
> All the references to FORCE should probably mention .PHONY as an alternative.

I do not get your point.

All the examples in the makefile.txt correctly reference to FORCE.
They are not PHONY targets.
No need to update.
Andy Lutomirski March 14, 2016, 4:44 a.m. UTC | #5
On Sun, Mar 13, 2016 at 9:36 PM, Masahiro Yamada
<yamada.masahiro@socionext.com> wrote:
> 2016-03-14 13:28 GMT+09:00 Andy Lutomirski <luto@amacapital.net>:
>> On Sun, Mar 13, 2016 at 9:08 PM, Masahiro Yamada
>> <yamada.masahiro@socionext.com> wrote:
>>>
>>> Hi Andy
>>>
>>> 2016-03-14 9:39 GMT+09:00 Andy Lutomirski <luto@amacapital.net>:
>>> > On Mar 12, 2016 4:14 PM, "Masahiro Yamada"
>>> > <yamada.masahiro@socionext.com> wrote:
>>> >>
>>> >> These targets are marked as PHONY.  No need to add FORCE to their
>>> >> dependency.
>>> >
>>> > If this is, in fact, correct, can you update
>>> > Documentation/kbuild/makefiles.txt as well?
>>>
>>> Which line do you want me to update?
>>>
>>
>> All the references to FORCE should probably mention .PHONY as an alternative.
>
> I do not get your point.
>
> All the examples in the makefile.txt correctly reference to FORCE.
> They are not PHONY targets.
> No need to update.

But they could be.  For example:

                $(obj)/image: vmlinux FORCE
                        $(call if_changed,objcopy)

could be:

                 .PHONY: $(obj)/image
                $(obj)/image: vmlinux
                        $(call if_changed,objcopy)

I would at least change:

Note: It is a typical mistake to forget the FORCE prerequisite.

to:

Note: if-changed is only useful if make executes it, which won't
happen if it determines that the inputs have not changed since the
output was built.  This can be avoided by specifying FORCE as a
prerequisite or by making declaring the output as .PHONY.

--Andy

>
>
>
>
> --
> Best Regards
> Masahiro Yamada
Michal Marek April 20, 2016, 8:29 a.m. UTC | #6
Dne 13.3.2016 v 01:13 Masahiro Yamada napsal(a):
> These targets are marked as PHONY.  No need to add FORCE to their
> dependency.
> 
> Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
> ---
> 
>  Makefile                     | 8 ++++----
>  arch/arm/vdso/Makefile       | 2 +-
>  arch/ia64/Makefile           | 4 ++--
>  arch/x86/entry/vdso/Makefile | 4 ++--
>  4 files changed, 9 insertions(+), 9 deletions(-)

Applied to kbuild.git#kbuild now, sorry for the delay.

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/Makefile b/Makefile
index 2d519d2..e3ef6b6 100644
--- a/Makefile
+++ b/Makefile
@@ -142,7 +142,7 @@  PHONY += $(MAKECMDGOALS) sub-make
 $(filter-out _all sub-make $(CURDIR)/Makefile, $(MAKECMDGOALS)) _all: sub-make
 	@:
 
-sub-make: FORCE
+sub-make:
 	$(Q)$(MAKE) -C $(KBUILD_OUTPUT) KBUILD_SRC=$(CURDIR) \
 	-f $(CURDIR)/Makefile $(filter-out _all sub-make,$(MAKECMDGOALS))
 
@@ -989,7 +989,7 @@  prepare1: prepare2 $(version_h) include/generated/utsrelease.h \
 
 archprepare: archheaders archscripts prepare1 scripts_basic
 
-prepare0: archprepare FORCE
+prepare0: archprepare
 	$(Q)$(MAKE) $(build)=.
 
 # All the preparing..
@@ -1034,7 +1034,7 @@  INSTALL_FW_PATH=$(INSTALL_MOD_PATH)/lib/firmware
 export INSTALL_FW_PATH
 
 PHONY += firmware_install
-firmware_install: FORCE
+firmware_install:
 	@mkdir -p $(objtree)/firmware
 	$(Q)$(MAKE) -f $(srctree)/scripts/Makefile.fwinst obj=firmware __fw_install
 
@@ -1054,7 +1054,7 @@  PHONY += archscripts
 archscripts:
 
 PHONY += __headers
-__headers: $(version_h) scripts_basic asm-generic archheaders archscripts FORCE
+__headers: $(version_h) scripts_basic asm-generic archheaders archscripts
 	$(Q)$(MAKE) $(build)=scripts build_unifdef
 
 PHONY += headers_install_all
diff --git a/arch/arm/vdso/Makefile b/arch/arm/vdso/Makefile
index 1160434..59a8fa7 100644
--- a/arch/arm/vdso/Makefile
+++ b/arch/arm/vdso/Makefile
@@ -74,5 +74,5 @@  $(MODLIB)/vdso: FORCE
 	@mkdir -p $(MODLIB)/vdso
 
 PHONY += vdso_install
-vdso_install: $(obj)/vdso.so.dbg $(MODLIB)/vdso FORCE
+vdso_install: $(obj)/vdso.so.dbg $(MODLIB)/vdso
 	$(call cmd,vdso_install)
diff --git a/arch/ia64/Makefile b/arch/ia64/Makefile
index 970d0bd..648f1ce 100644
--- a/arch/ia64/Makefile
+++ b/arch/ia64/Makefile
@@ -95,8 +95,8 @@  define archhelp
   echo '* unwcheck	- Check vmlinux for invalid unwind info'
 endef
 
-archprepare: make_nr_irqs_h FORCE
+archprepare: make_nr_irqs_h
 PHONY += make_nr_irqs_h FORCE
 
-make_nr_irqs_h: FORCE
+make_nr_irqs_h:
 	$(Q)$(MAKE) $(build)=arch/ia64/kernel include/generated/nr-irqs.h
diff --git a/arch/x86/entry/vdso/Makefile b/arch/x86/entry/vdso/Makefile
index c854541..a81b539 100644
--- a/arch/x86/entry/vdso/Makefile
+++ b/arch/x86/entry/vdso/Makefile
@@ -188,10 +188,10 @@  vdso_img_insttargets := $(vdso_img_sodbg:%.dbg=install_%)
 $(MODLIB)/vdso: FORCE
 	@mkdir -p $(MODLIB)/vdso
 
-$(vdso_img_insttargets): install_%: $(obj)/%.dbg $(MODLIB)/vdso FORCE
+$(vdso_img_insttargets): install_%: $(obj)/%.dbg $(MODLIB)/vdso
 	$(call cmd,vdso_install)
 
 PHONY += vdso_install $(vdso_img_insttargets)
-vdso_install: $(vdso_img_insttargets) FORCE
+vdso_install: $(vdso_img_insttargets)
 
 clean-files := vdso32.so vdso32.so.dbg vdso64* vdso-image-*.c vdsox32.so*