Merge tag 'auxdisplay-for-linus-v5.1-rc2' of git://github.com/ojeda/linux
[sfrench/cifs-2.6.git] / arch / s390 / boot / Makefile
1 # SPDX-License-Identifier: GPL-2.0
2 #
3 # Makefile for the linux s390-specific parts of the memory manager.
4 #
5
6 KCOV_INSTRUMENT := n
7 GCOV_PROFILE := n
8 UBSAN_SANITIZE := n
9 KASAN_SANITIZE := n
10
11 KBUILD_AFLAGS := $(KBUILD_AFLAGS_DECOMPRESSOR)
12 KBUILD_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 #
18 ifneq ($(CC_FLAGS_MARCH),-march=z900)
19 AFLAGS_REMOVE_head.o            += $(CC_FLAGS_MARCH)
20 AFLAGS_head.o                   += -march=z900
21 AFLAGS_REMOVE_mem.o             += $(CC_FLAGS_MARCH)
22 AFLAGS_mem.o                    += -march=z900
23 CFLAGS_REMOVE_als.o             += $(CC_FLAGS_MARCH)
24 CFLAGS_als.o                    += -march=z900
25 CFLAGS_REMOVE_sclp_early_core.o += $(CC_FLAGS_MARCH)
26 CFLAGS_sclp_early_core.o        += -march=z900
27 endif
28
29 CFLAGS_sclp_early_core.o += -I$(srctree)/drivers/s390/char
30
31 obj-y   := head.o als.o startup.o mem_detect.o ipl_parm.o string.o ebcdic.o
32 obj-y   += sclp_early_core.o mem.o ipl_vmparm.o cmdline.o ctype.o
33 targets := bzImage startup.a section_cmp.boot.data $(obj-y)
34 subdir- := compressed
35
36 OBJECTS := $(addprefix $(obj)/,$(obj-y))
37
38 quiet_cmd_section_cmp = SECTCMP $*
39 define 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 $@
49 endef
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
63 install: $(CONFIGURE) $(obj)/bzImage
64         sh -x  $(srctree)/$(obj)/install.sh $(KERNELRELEASE) $(obj)/bzImage \
65               System.map "$(INSTALL_PATH)"
66
67 chkbss := $(obj-y)
68 chkbss-target := startup.a
69 include $(srctree)/arch/s390/scripts/Makefile.chkbss