summaryrefslogtreecommitdiffstats
path: root/arch/s390/scripts
diff options
context:
space:
mode:
authorVasily Gorbik <gor@linux.ibm.com>2018-07-01 11:32:51 +0200
committerMartin Schwidefsky <schwidefsky@de.ibm.com>2018-07-02 12:32:23 +0200
commit251987a8025da049f42001bdb21250f79644ede3 (patch)
tree31ee2c336a32d5b4cc8f1a3802883910e29ed4c3 /arch/s390/scripts
parent7e0363b469f5d2ad00234497aad65c7b46db42c0 (diff)
downloadlinux-251987a8025da049f42001bdb21250f79644ede3.tar.bz2
s390/build: add *.o.chkbss files to targets list
Adding *.o.chkbss files to targets list makes sure that the kbuild is aware of them and removes them during make clean. Also remove *.o.chkbss file before an actual check, to avoid having stale *.o.chkbss file left even if the check is failed. Acked-by: Heiko Carstens <heiko.carstens@de.ibm.com> Signed-off-by: Vasily Gorbik <gor@linux.ibm.com> Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Diffstat (limited to 'arch/s390/scripts')
-rw-r--r--arch/s390/scripts/Makefile.chkbss8
1 files changed, 6 insertions, 2 deletions
diff --git a/arch/s390/scripts/Makefile.chkbss b/arch/s390/scripts/Makefile.chkbss
index fb0a11bd520c..9bba2c14e0ca 100644
--- a/arch/s390/scripts/Makefile.chkbss
+++ b/arch/s390/scripts/Makefile.chkbss
@@ -2,6 +2,7 @@
quiet_cmd_chkbss = CHKBSS $<
define cmd_chkbss
+ rm -f $@; \
if ! $(OBJDUMP) -j .bss -w -h $< | awk 'END { if ($$3) exit 1 }'; then \
echo "error: $< .bss section is not empty" >&2; exit 1; \
fi; \
@@ -10,10 +11,13 @@ endef
chkbss-target ?= $(obj)/built-in.a
ifneq (,$(findstring /,$(chkbss)))
-$(chkbss-target): $(patsubst %, %.chkbss, $(chkbss))
+chkbss-files := $(patsubst %, %.chkbss, $(chkbss))
else
-$(chkbss-target): $(patsubst %, $(obj)/%.chkbss, $(chkbss))
+chkbss-files := $(patsubst %, $(obj)/%.chkbss, $(chkbss))
endif
+$(chkbss-target): $(chkbss-files)
+targets += $(notdir $(chkbss-files))
+
%.o.chkbss: %.o
$(call cmd,chkbss)