GNU Linux-libre 4.19.295-gnu1
[releases.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 ebcdic.o sclp_early_core.o mem.o
32 targets := bzImage startup.a $(obj-y)
33 subdir- := compressed
34
35 OBJECTS := $(addprefix $(obj)/,$(obj-y))
36
37 $(obj)/bzImage: $(obj)/compressed/vmlinux FORCE
38         $(call if_changed,objcopy)
39
40 $(obj)/compressed/vmlinux: $(obj)/startup.a FORCE
41         $(Q)$(MAKE) $(build)=$(obj)/compressed $@
42
43 quiet_cmd_ar = AR      $@
44       cmd_ar = rm -f $@; $(AR) rcsTP$(KBUILD_ARFLAGS) $@ $(filter $(OBJECTS), $^)
45
46 $(obj)/startup.a: $(OBJECTS) FORCE
47         $(call if_changed,ar)
48
49 install:
50         sh -x  $(srctree)/$(obj)/install.sh $(KERNELRELEASE) $(obj)/bzImage \
51               System.map "$(INSTALL_PATH)"
52
53 chkbss := $(OBJECTS)
54 chkbss-target := $(obj)/startup.a
55 include $(srctree)/arch/s390/scripts/Makefile.chkbss