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; \
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)