xref: /linux/arch/s390/boot/Makefile (revision be709d48329a500621d2a05835283150ae137b45)
1# SPDX-License-Identifier: GPL-2.0
2#
3# Makefile for the linux s390-specific parts of the memory manager.
4#
5
6KCOV_INSTRUMENT := n
7GCOV_PROFILE := n
8UBSAN_SANITIZE := n
9KASAN_SANITIZE := n
10
11KBUILD_AFLAGS := $(KBUILD_AFLAGS_DECOMPRESSOR)
12KBUILD_CFLAGS := $(KBUILD_CFLAGS_DECOMPRESSOR)
13
14#
15# Use -march=z900 for als.c to be able to print an error
16# message if the kernel is started on a machine which is too old
17#
18ifneq ($(CC_FLAGS_MARCH),-march=z900)
19AFLAGS_REMOVE_head.o		+= $(CC_FLAGS_MARCH)
20AFLAGS_head.o			+= -march=z900
21AFLAGS_REMOVE_mem.o		+= $(CC_FLAGS_MARCH)
22AFLAGS_mem.o			+= -march=z900
23CFLAGS_REMOVE_als.o		+= $(CC_FLAGS_MARCH)
24CFLAGS_als.o			+= -march=z900
25CFLAGS_REMOVE_sclp_early_core.o	+= $(CC_FLAGS_MARCH)
26CFLAGS_sclp_early_core.o	+= -march=z900
27endif
28
29CFLAGS_sclp_early_core.o += -I$(srctree)/drivers/s390/char
30
31obj-y	:= head.o als.o startup.o mem_detect.o ipl_parm.o string.o ebcdic.o
32obj-y	+= sclp_early_core.o mem.o ipl_vmparm.o cmdline.o ctype.o
33targets	:= bzImage startup.a section_cmp.boot.data $(obj-y)
34subdir-	:= compressed
35
36OBJECTS := $(addprefix $(obj)/,$(obj-y))
37
38quiet_cmd_section_cmp = SECTCMP $*
39define cmd_section_cmp
40	s1=`$(OBJDUMP) -t -j "$*" "$<" | sort | \
41		sed -n "/0000000000000000/! s/.*\s$*\s\+//p" | sha256sum`; \
42	s2=`$(OBJDUMP) -t -j "$*" "$(word 2,$^)" | sort | \
43		sed -n "/0000000000000000/! s/.*\s$*\s\+//p" | sha256sum`; \
44	if [ "$$s1" != "$$s2" ]; then \
45		echo "error: section $* differs between $< and $(word 2,$^)" >&2; \
46		exit 1; \
47	fi; \
48	touch $@
49endef
50
51$(obj)/bzImage: $(obj)/compressed/vmlinux $(obj)/section_cmp.boot.data FORCE
52	$(call if_changed,objcopy)
53
54$(obj)/section_cmp%: vmlinux $(obj)/compressed/vmlinux FORCE
55	$(call if_changed,section_cmp)
56
57$(obj)/compressed/vmlinux: $(obj)/startup.a FORCE
58	$(Q)$(MAKE) $(build)=$(obj)/compressed $@
59
60$(obj)/startup.a: $(OBJECTS) FORCE
61	$(call if_changed,ar)
62
63install: $(CONFIGURE) $(obj)/bzImage
64	sh -x  $(srctree)/$(obj)/install.sh $(KERNELRELEASE) $(obj)/bzImage \
65	      System.map "$(INSTALL_PATH)"
66
67chkbss := $(obj-y)
68chkbss-target := startup.a
69include $(srctree)/arch/s390/scripts/Makefile.chkbss
70