summaryrefslogtreecommitdiffstats
path: root/arch/s390/scripts/Makefile.chkbss
blob: 9bba2c14e0cafbcad575cd3f44f2521b9bed79af (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
# 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)