xref: /openbmc/linux/arch/s390/boot/Makefile (revision 7c768f84)
1# SPDX-License-Identifier: GPL-2.0
2#
3# Makefile for the linux s390-specific parts of the memory manager.
4#
5
6KCOV_INSTRUMENT := n
7GCOV_PROFILE := n
8UBSAN_SANITIZE := n
9
10KBUILD_AFLAGS := $(KBUILD_AFLAGS_DECOMPRESSOR)
11KBUILD_CFLAGS := $(KBUILD_CFLAGS_DECOMPRESSOR)
12
13#
14# Use -march=z900 for als.c to be able to print an error
15# message if the kernel is started on a machine which is too old
16#
17ifneq ($(CC_FLAGS_MARCH),-march=z900)
18AFLAGS_REMOVE_head.o		+= $(CC_FLAGS_MARCH)
19AFLAGS_head.o			+= -march=z900
20AFLAGS_REMOVE_mem.o		+= $(CC_FLAGS_MARCH)
21AFLAGS_mem.o			+= -march=z900
22CFLAGS_REMOVE_als.o		+= $(CC_FLAGS_MARCH)
23CFLAGS_als.o			+= -march=z900
24CFLAGS_REMOVE_sclp_early_core.o	+= $(CC_FLAGS_MARCH)
25CFLAGS_sclp_early_core.o	+= -march=z900
26endif
27
28CFLAGS_sclp_early_core.o += -I$(srctree)/drivers/s390/char
29
30obj-y	:= head.o als.o ebcdic.o sclp_early_core.o mem.o
31targets	:= bzImage startup.a $(obj-y)
32subdir-	:= compressed
33
34OBJECTS := $(addprefix $(obj)/,$(obj-y))
35
36$(obj)/bzImage: $(obj)/compressed/vmlinux FORCE
37	$(call if_changed,objcopy)
38
39$(obj)/compressed/vmlinux: $(obj)/startup.a FORCE
40	$(Q)$(MAKE) $(build)=$(obj)/compressed $@
41
42quiet_cmd_ar = AR      $@
43      cmd_ar = rm -f $@; $(AR) rcsTP$(KBUILD_ARFLAGS) $@ $(filter $(OBJECTS), $^)
44
45$(obj)/startup.a: $(OBJECTS) FORCE
46	$(call if_changed,ar)
47
48install: $(CONFIGURE) $(obj)/bzImage
49	sh -x  $(srctree)/$(obj)/install.sh $(KERNELRELEASE) $(obj)/bzImage \
50	      System.map "$(INSTALL_PATH)"
51
52chkbss := $(OBJECTS)
53chkbss-target := $(obj)/startup.a
54include $(srctree)/arch/s390/scripts/Makefile.chkbss
55