1 # SPDX-License-Identifier: GPL-2.0
3 # Makefile for the linux s390-specific parts of the memory manager.
11 KBUILD_AFLAGS
:= $(KBUILD_AFLAGS_DECOMPRESSOR
)
12 KBUILD_CFLAGS
:= $(KBUILD_CFLAGS_DECOMPRESSOR
)
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
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
29 CFLAGS_sclp_early_core.o
+= -I
$(srctree
)/drivers
/s390
/char
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
)
36 OBJECTS
:= $(addprefix $(obj
)/,$(obj-y
))
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; \
51 $(obj
)/bzImage
: $(obj
)/compressed
/vmlinux
$(obj
)/section_cmp.boot.data FORCE
52 $(call if_changed
,objcopy
)
54 $(obj
)/section_cmp
%: vmlinux
$(obj
)/compressed
/vmlinux FORCE
55 $(call if_changed
,section_cmp
)
57 $(obj
)/compressed
/vmlinux
: $(obj
)/startup.a FORCE
58 $(Q
)$(MAKE
) $(build
)=$(obj
)/compressed
$@
61 cmd_ar
= rm -f
$@
; $(AR
) rcsTP
$(KBUILD_ARFLAGS
) $@
$(filter $(OBJECTS
), $^
)
63 $(obj
)/startup.a
: $(OBJECTS
) FORCE
66 install: $(CONFIGURE
) $(obj
)/bzImage
67 sh
-x
$(srctree
)/$(obj
)/install.sh
$(KERNELRELEASE
) $(obj
)/bzImage \
68 System.map
"$(INSTALL_PATH)"
71 chkbss-target
:= $(obj
)/startup.a
72 include $(srctree
)/arch
/s390
/scripts
/Makefile.chkbss