Greg Kroah-Hartman | b244131 | 2017-11-01 15:07:57 +0100 | [diff] [blame] | 1 | # SPDX-License-Identifier: GPL-2.0 |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 2 | # |
| 3 | # Makefile for the linux s390-specific parts of the memory manager. |
| 4 | # |
| 5 | |
Vasily Gorbik | 8282cd6 | 2018-06-12 15:11:40 +0200 | [diff] [blame] | 6 | KCOV_INSTRUMENT := n |
| 7 | GCOV_PROFILE := n |
| 8 | UBSAN_SANITIZE := n |
Vasily Gorbik | 0a9b409 | 2017-11-17 13:10:33 +0100 | [diff] [blame] | 9 | KASAN_SANITIZE := n |
Vasily Gorbik | 8282cd6 | 2018-06-12 15:11:40 +0200 | [diff] [blame] | 10 | |
| 11 | KBUILD_AFLAGS := $(KBUILD_AFLAGS_DECOMPRESSOR) |
| 12 | KBUILD_CFLAGS := $(KBUILD_CFLAGS_DECOMPRESSOR) |
| 13 | |
| 14 | # |
Arnd Bergmann | c263a4e | 2019-04-15 10:35:51 +0200 | [diff] [blame] | 15 | # Use minimum architecture for als.c to be able to print an error |
Vasily Gorbik | 8282cd6 | 2018-06-12 15:11:40 +0200 | [diff] [blame] | 16 | # message if the kernel is started on a machine which is too old |
| 17 | # |
Arnd Bergmann | c263a4e | 2019-04-15 10:35:51 +0200 | [diff] [blame] | 18 | ifndef CONFIG_CC_IS_CLANG |
| 19 | CC_FLAGS_MARCH_MINIMUM := -march=z900 |
| 20 | else |
| 21 | CC_FLAGS_MARCH_MINIMUM := -march=z10 |
| 22 | endif |
| 23 | |
| 24 | ifneq ($(CC_FLAGS_MARCH),$(CC_FLAGS_MARCH_MINIMUM)) |
Vasily Gorbik | a1d7d91 | 2018-06-12 15:52:01 +0200 | [diff] [blame] | 25 | AFLAGS_REMOVE_head.o += $(CC_FLAGS_MARCH) |
Arnd Bergmann | c263a4e | 2019-04-15 10:35:51 +0200 | [diff] [blame] | 26 | AFLAGS_head.o += $(CC_FLAGS_MARCH_MINIMUM) |
Vasily Gorbik | cad5b35 | 2018-06-12 22:58:50 +0200 | [diff] [blame] | 27 | AFLAGS_REMOVE_mem.o += $(CC_FLAGS_MARCH) |
Arnd Bergmann | c263a4e | 2019-04-15 10:35:51 +0200 | [diff] [blame] | 28 | AFLAGS_mem.o += $(CC_FLAGS_MARCH_MINIMUM) |
Vasily Gorbik | a1d7d91 | 2018-06-12 15:52:01 +0200 | [diff] [blame] | 29 | CFLAGS_REMOVE_als.o += $(CC_FLAGS_MARCH) |
Arnd Bergmann | c263a4e | 2019-04-15 10:35:51 +0200 | [diff] [blame] | 30 | CFLAGS_als.o += $(CC_FLAGS_MARCH_MINIMUM) |
Vasily Gorbik | a1d7d91 | 2018-06-12 15:52:01 +0200 | [diff] [blame] | 31 | CFLAGS_REMOVE_sclp_early_core.o += $(CC_FLAGS_MARCH) |
Arnd Bergmann | c263a4e | 2019-04-15 10:35:51 +0200 | [diff] [blame] | 32 | CFLAGS_sclp_early_core.o += $(CC_FLAGS_MARCH_MINIMUM) |
Vasily Gorbik | 8282cd6 | 2018-06-12 15:11:40 +0200 | [diff] [blame] | 33 | endif |
| 34 | |
Vasily Gorbik | a1d7d91 | 2018-06-12 15:52:01 +0200 | [diff] [blame] | 35 | CFLAGS_sclp_early_core.o += -I$(srctree)/drivers/s390/char |
| 36 | |
Martin Schwidefsky | 9641b8c | 2019-02-21 14:23:04 +0100 | [diff] [blame] | 37 | obj-y := head.o als.o startup.o mem_detect.o ipl_parm.o ipl_report.o |
| 38 | obj-y += string.o ebcdic.o sclp_early_core.o mem.o ipl_vmparm.o cmdline.o |
Gerald Schaefer | a80313f | 2019-02-03 21:37:20 +0100 | [diff] [blame] | 39 | obj-y += ctype.o text_dma.o |
Vasily Gorbik | 5abb935 | 2019-04-01 19:11:03 +0200 | [diff] [blame] | 40 | obj-$(CONFIG_PROTECTED_VIRTUALIZATION_GUEST) += uv.o |
Gerald Schaefer | 805bc0b | 2019-02-03 21:35:45 +0100 | [diff] [blame] | 41 | obj-$(CONFIG_RELOCATABLE) += machine_kexec_reloc.o |
Gerald Schaefer | b2d24b9 | 2019-02-03 21:37:20 +0100 | [diff] [blame] | 42 | obj-$(CONFIG_RANDOMIZE_BASE) += kaslr.o |
Vasily Gorbik | fd184e1 | 2019-04-01 19:10:56 +0200 | [diff] [blame] | 43 | targets := bzImage startup.a section_cmp.boot.data section_cmp.boot.preserved.data $(obj-y) |
Vasily Gorbik | 8282cd6 | 2018-06-12 15:11:40 +0200 | [diff] [blame] | 44 | subdir- := compressed |
| 45 | |
| 46 | OBJECTS := $(addprefix $(obj)/,$(obj-y)) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 47 | |
Vasily Gorbik | 251b72a | 2018-04-10 14:24:40 +0200 | [diff] [blame] | 48 | quiet_cmd_section_cmp = SECTCMP $* |
| 49 | define cmd_section_cmp |
| 50 | s1=`$(OBJDUMP) -t -j "$*" "$<" | sort | \ |
| 51 | sed -n "/0000000000000000/! s/.*\s$*\s\+//p" | sha256sum`; \ |
| 52 | s2=`$(OBJDUMP) -t -j "$*" "$(word 2,$^)" | sort | \ |
| 53 | sed -n "/0000000000000000/! s/.*\s$*\s\+//p" | sha256sum`; \ |
| 54 | if [ "$$s1" != "$$s2" ]; then \ |
| 55 | echo "error: section $* differs between $< and $(word 2,$^)" >&2; \ |
| 56 | exit 1; \ |
| 57 | fi; \ |
| 58 | touch $@ |
| 59 | endef |
| 60 | |
Vasily Gorbik | fd184e1 | 2019-04-01 19:10:56 +0200 | [diff] [blame] | 61 | $(obj)/bzImage: $(obj)/compressed/vmlinux $(obj)/section_cmp.boot.data $(obj)/section_cmp.boot.preserved.data FORCE |
Martin Schwidefsky | 1844c9b | 2010-02-26 22:37:53 +0100 | [diff] [blame] | 62 | $(call if_changed,objcopy) |
| 63 | |
Vasily Gorbik | 251b72a | 2018-04-10 14:24:40 +0200 | [diff] [blame] | 64 | $(obj)/section_cmp%: vmlinux $(obj)/compressed/vmlinux FORCE |
| 65 | $(call if_changed,section_cmp) |
| 66 | |
Vasily Gorbik | 8282cd6 | 2018-06-12 15:11:40 +0200 | [diff] [blame] | 67 | $(obj)/compressed/vmlinux: $(obj)/startup.a FORCE |
Martin Schwidefsky | 1844c9b | 2010-02-26 22:37:53 +0100 | [diff] [blame] | 68 | $(Q)$(MAKE) $(build)=$(obj)/compressed $@ |
| 69 | |
Vasily Gorbik | 8282cd6 | 2018-06-12 15:11:40 +0200 | [diff] [blame] | 70 | $(obj)/startup.a: $(OBJECTS) FORCE |
| 71 | $(call if_changed,ar) |
| 72 | |
Hendrik Brueckner | aec644e5 | 2013-11-08 13:47:59 +0100 | [diff] [blame] | 73 | install: $(CONFIGURE) $(obj)/bzImage |
| 74 | sh -x $(srctree)/$(obj)/install.sh $(KERNELRELEASE) $(obj)/bzImage \ |
Heiko Carstens | 679e2ea | 2011-12-27 11:27:17 +0100 | [diff] [blame] | 75 | System.map "$(INSTALL_PATH)" |
Vasily Gorbik | 0580bce | 2018-05-16 10:57:44 +0200 | [diff] [blame] | 76 | |
Masahiro Yamada | 5d68005 | 2019-01-17 19:02:42 +0900 | [diff] [blame] | 77 | chkbss := $(obj-y) |
| 78 | chkbss-target := startup.a |
Vasily Gorbik | 0580bce | 2018-05-16 10:57:44 +0200 | [diff] [blame] | 79 | include $(srctree)/arch/s390/scripts/Makefile.chkbss |