[lkml]   [2017]   [Jun]   [24]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
Patch in this message
Subject[PATCH] tile: fix dependency and .*.cmd inclusion for incremental build
Build targets using if_changed(_rule) must depend on FORCE so that
they are evaluated every time.

In order to include .*.cmd files correctly, build targets added to
"targets" must not be prefixed with $(obj)/ because it is done by
scripts/Makefile.lib .

Signed-off-by: Masahiro Yamada <>

I found this Makefile in the mainline is already broken
for incremental building.

I inserted this before thin archive migration patches.

arch/tile/kernel/vdso/Makefile | 11 +++++------
1 file changed, 5 insertions(+), 6 deletions(-)

diff --git a/arch/tile/kernel/vdso/Makefile b/arch/tile/kernel/vdso/Makefile
index c54fff3..cf162a2 100644
--- a/arch/tile/kernel/vdso/Makefile
+++ b/arch/tile/kernel/vdso/Makefile
@@ -42,10 +42,9 @@ $(obj)/vdso.o: $(obj)/

# link rule for the .so file, .lds has to be first = $(c_flags)
-$(obj)/ $(src)/ $(obj-vdso)
+$(obj)/ $(src)/ $(obj-vdso) FORCE
$(call if_changed,vdsold)

# We also create a special relocatable object that should mirror the symbol
# table and layout of the linked DSO. With ld -R we can then refer to
# these symbols in the kernel code rather than hand-coded addresses.
@@ -96,17 +95,17 @@ KBUILD_CFLAGS_32 := $(filter-out -m64,$(KBUILD_CFLAGS))
KBUILD_CFLAGS_32 += -m32 -fPIC -shared

obj-vdso32 = $(patsubst %, v%32.o, $(vdso-syms))
-obj-vdso32 := $(addprefix $(obj)/, $(obj-vdso32))

targets += $(obj-vdso32)
+obj-vdso32 := $(addprefix $(obj)/, $(obj-vdso32))

$(obj-vdso32:%=%): KBUILD_AFLAGS = $(KBUILD_AFLAGS_32)
$(obj-vdso32:%=%): KBUILD_CFLAGS = $(KBUILD_CFLAGS_32)

-$(obj)/vgettimeofday32.o: $(obj)/vgettimeofday.c
+$(obj)/vgettimeofday32.o: $(obj)/vgettimeofday.c FORCE
$(call if_changed_rule,cc_o_c)

-$(obj)/vrt_sigreturn32.o: $(obj)/vrt_sigreturn.S
+$(obj)/vrt_sigreturn32.o: $(obj)/vrt_sigreturn.S FORCE
$(call if_changed,as_o_S)

# Force dependency
@@ -114,5 +113,5 @@ $(obj)/vdso32.o: $(obj)/ = -m32 -shared -s -Wl, \
$(call cc-ldoption, -Wl$(comma)--hash-style=both)
-$(obj)/ $(src)/ $(obj-vdso32)
+$(obj)/ $(src)/ $(obj-vdso32) FORCE
$(call if_changed,vdsold)
 \ /
  Last update: 2017-06-25 05:17    [W:0.024 / U:1.520 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site