Makefile 2.5 KB
Newer Older
1
# SPDX-License-Identifier: GPL-2.0
L
Linus Torvalds 已提交
2 3 4 5
#
# Makefile for the linux s390-specific parts of the memory manager.
#

6 7 8
KCOV_INSTRUMENT := n
GCOV_PROFILE := n
UBSAN_SANITIZE := n
9
KASAN_SANITIZE := n
10 11 12 13 14

KBUILD_AFLAGS := $(KBUILD_AFLAGS_DECOMPRESSOR)
KBUILD_CFLAGS := $(KBUILD_CFLAGS_DECOMPRESSOR)

#
15
# Use minimum architecture for als.c to be able to print an error
16 17
# message if the kernel is started on a machine which is too old
#
18 19 20 21 22 23 24
ifndef CONFIG_CC_IS_CLANG
CC_FLAGS_MARCH_MINIMUM := -march=z900
else
CC_FLAGS_MARCH_MINIMUM := -march=z10
endif

ifneq ($(CC_FLAGS_MARCH),$(CC_FLAGS_MARCH_MINIMUM))
25
AFLAGS_REMOVE_head.o		+= $(CC_FLAGS_MARCH)
26
AFLAGS_head.o			+= $(CC_FLAGS_MARCH_MINIMUM)
27
AFLAGS_REMOVE_mem.o		+= $(CC_FLAGS_MARCH)
28
AFLAGS_mem.o			+= $(CC_FLAGS_MARCH_MINIMUM)
29
CFLAGS_REMOVE_als.o		+= $(CC_FLAGS_MARCH)
30
CFLAGS_als.o			+= $(CC_FLAGS_MARCH_MINIMUM)
31
CFLAGS_REMOVE_sclp_early_core.o	+= $(CC_FLAGS_MARCH)
32
CFLAGS_sclp_early_core.o	+= $(CC_FLAGS_MARCH_MINIMUM)
33 34
endif

35 36
CFLAGS_sclp_early_core.o += -I$(srctree)/drivers/s390/char

37 38
obj-y	:= head.o als.o startup.o mem_detect.o ipl_parm.o ipl_report.o
obj-y	+= string.o ebcdic.o sclp_early_core.o mem.o ipl_vmparm.o cmdline.o
39
obj-y	+= ctype.o text_dma.o
40
obj-$(CONFIG_PROTECTED_VIRTUALIZATION_GUEST)	+= uv.o
41
obj-$(CONFIG_RELOCATABLE)	+= machine_kexec_reloc.o
42
obj-$(CONFIG_RANDOMIZE_BASE)	+= kaslr.o
43
targets	:= bzImage startup.a section_cmp.boot.data section_cmp.boot.preserved.data $(obj-y)
44 45 46
subdir-	:= compressed

OBJECTS := $(addprefix $(obj)/,$(obj-y))
L
Linus Torvalds 已提交
47

48 49 50 51 52 53 54 55 56 57 58 59 60
quiet_cmd_section_cmp = SECTCMP $*
define cmd_section_cmp
	s1=`$(OBJDUMP) -t -j "$*" "$<" | sort | \
		sed -n "/0000000000000000/! s/.*\s$*\s\+//p" | sha256sum`; \
	s2=`$(OBJDUMP) -t -j "$*" "$(word 2,$^)" | sort | \
		sed -n "/0000000000000000/! s/.*\s$*\s\+//p" | sha256sum`; \
	if [ "$$s1" != "$$s2" ]; then \
		echo "error: section $* differs between $< and $(word 2,$^)" >&2; \
		exit 1; \
	fi; \
	touch $@
endef

61
$(obj)/bzImage: $(obj)/compressed/vmlinux $(obj)/section_cmp.boot.data $(obj)/section_cmp.boot.preserved.data FORCE
62 63
	$(call if_changed,objcopy)

64 65 66
$(obj)/section_cmp%: vmlinux $(obj)/compressed/vmlinux FORCE
	$(call if_changed,section_cmp)

67
$(obj)/compressed/vmlinux: $(obj)/startup.a FORCE
68 69
	$(Q)$(MAKE) $(build)=$(obj)/compressed $@

70 71 72
$(obj)/startup.a: $(OBJECTS) FORCE
	$(call if_changed,ar)

73 74
install: $(CONFIGURE) $(obj)/bzImage
	sh -x  $(srctree)/$(obj)/install.sh $(KERNELRELEASE) $(obj)/bzImage \
H
Heiko Carstens 已提交
75
	      System.map "$(INSTALL_PATH)"
76

77 78
chkbss := $(obj-y)
chkbss-target := startup.a
79
include $(srctree)/arch/s390/scripts/Makefile.chkbss