summaryrefslogtreecommitdiffstats
path: root/arch/s390/scripts/Makefile.chkbss
blob: 884a9caff5fb8be71c80fce894d78ef1fe5f955d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
# SPDX-License-Identifier: GPL-2.0

chkbss-target ?= built-in.a
$(obj)/$(chkbss-target): chkbss

chkbss-files := $(addsuffix .chkbss, $(chkbss))
clean-files += $(chkbss-files)

PHONY += chkbss
chkbss: $(addprefix $(obj)/, $(chkbss-files))

quiet_cmd_chkbss = CHKBSS  $<
      cmd_chkbss = \
	if $(OBJDUMP) -h $< | grep -q "\.bss" && \
	   ! $(OBJDUMP) -j .bss -w -h $< | awk 'END { if ($$3) exit 1 }'; then \
		echo "error: $< .bss section is not empty" >&2; exit 1; \
	fi; \
	touch $@;

$(obj)/%.o.chkbss: $(obj)/%.o
	$(call cmd,chkbss)