mirror of
https://github.com/AuxXxilium/linux_dsm_epyc7002.git
synced 2024-12-28 11:18:45 +07:00
251987a802
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>
24 lines
555 B
Makefile
24 lines
555 B
Makefile
# SPDX-License-Identifier: GPL-2.0
|
|
|
|
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; \
|
|
touch $@;
|
|
endef
|
|
|
|
chkbss-target ?= $(obj)/built-in.a
|
|
ifneq (,$(findstring /,$(chkbss)))
|
|
chkbss-files := $(patsubst %, %.chkbss, $(chkbss))
|
|
else
|
|
chkbss-files := $(patsubst %, $(obj)/%.chkbss, $(chkbss))
|
|
endif
|
|
|
|
$(chkbss-target): $(chkbss-files)
|
|
targets += $(notdir $(chkbss-files))
|
|
|
|
%.o.chkbss: %.o
|
|
$(call cmd,chkbss)
|