[PATCH] x86: Fix make clean

From: Michal Marek
Date: Fri Jan 09 2015 - 06:17:27 EST


The $(targets) variable should not depend on the configuration, so that
make clean always cleans every possible generated file. Where this is
impractical, list the potential products of a build in $(clean-files).

Reported-by: Linus Torvalds <torvalds@xxxxxxxxxxxxxxxxxxxx>
Signed-off-by: Michal Marek <mmarek@xxxxxxx>
---
arch/x86/boot/Makefile | 2 +-
arch/x86/kernel/cpu/Makefile | 2 +-
arch/x86/vdso/Makefile | 3 ++-
3 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/arch/x86/boot/Makefile b/arch/x86/boot/Makefile
index 5b016e2..b93cc4d 100644
--- a/arch/x86/boot/Makefile
+++ b/arch/x86/boot/Makefile
@@ -47,10 +47,10 @@ $(obj)/cpu.o: $(obj)/cpustr.h

quiet_cmd_cpustr = CPUSTR $@
cmd_cpustr = $(obj)/mkcpustr > $@
-targets += cpustr.h
$(obj)/cpustr.h: $(obj)/mkcpustr FORCE
$(call if_changed,cpustr)
endif
+targets += cpustr.h

# ---------------------------------------------------------------------------

diff --git a/arch/x86/kernel/cpu/Makefile b/arch/x86/kernel/cpu/Makefile
index e27b49d..6e864cf 100644
--- a/arch/x86/kernel/cpu/Makefile
+++ b/arch/x86/kernel/cpu/Makefile
@@ -62,7 +62,7 @@ quiet_cmd_mkcapflags = MKCAP $@

cpufeature = $(src)/../../include/asm/cpufeature.h

-targets += capflags.c
$(obj)/capflags.c: $(cpufeature) $(src)/mkcapflags.sh FORCE
$(call if_changed,mkcapflags)
endif
+targets += capflags.c
diff --git a/arch/x86/vdso/Makefile b/arch/x86/vdso/Makefile
index 5a4affe..f971e20 100644
--- a/arch/x86/vdso/Makefile
+++ b/arch/x86/vdso/Makefile
@@ -205,4 +205,5 @@ $(vdso_img_insttargets): install_%: $(obj)/%.dbg $(MODLIB)/vdso FORCE
PHONY += vdso_install $(vdso_img_insttargets)
vdso_install: $(vdso_img_insttargets) FORCE

-clean-files := vdso32-syscall* vdso32-sysenter* vdso32-int80*
+clean-files := vdso-image-* vdso32-syscall* vdso32-sysenter* vdso32-int80* \
+ *.so *.so.dbg
--
1.9.2

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/