1# SPDX-License-Identifier: GPL-2.0
2
3chkbss-target ?= built-in.a
4$(obj)/$(chkbss-target): chkbss
5
6chkbss-files := $(addsuffix .chkbss, $(chkbss))
7clean-files += $(chkbss-files)
8
9PHONY += chkbss
10chkbss: $(addprefix $(obj)/, $(chkbss-files))
11
12quiet_cmd_chkbss = CHKBSS  $<
13      cmd_chkbss = \
14	if ! $(OBJSIZE) --common $< | $(AWK) 'END { if ($$3) exit 1 }'; then \
15		echo "error: $< .bss section is not empty" >&2; exit 1; \
16	fi; \
17	touch $@;
18
19$(obj)/%.o.chkbss: $(obj)/%.o
20	$(call cmd,chkbss)
21