blob: ccdfa1f7bbc93f2955d7a208ecf9f2faa08effec [file] [log] [blame]
Catalin Marinas8c2c3df2012-04-20 14:45:54 +01001#
2# arch/arm64/boot/Makefile
3#
4# This file is included by the global makefile so that you can add your own
5# architecture-specific flags and dependencies.
6#
7# This file is subject to the terms and conditions of the GNU General Public
8# License. See the file "COPYING" in the main directory of this archive
9# for more details.
10#
11# Copyright (C) 2012, ARM Ltd.
12# Author: Will Deacon <will.deacon@arm.com>
13#
14# Based on the ia64 boot/Makefile.
15#
16
Alex Ray911da232014-03-17 13:44:01 -070017include $(srctree)/arch/arm64/boot/dts/Makefile
18
Mark Rutlandf8fa70f2016-07-12 16:28:01 +010019OBJCOPYFLAGS_Image :=-O binary -R .note -R .note.gnu.build-id -R .comment -S
20
Catalin Marinas8c2c3df2012-04-20 14:45:54 +010021targets := Image Image.gz
22
Alex Raye2d9f0a2014-03-17 13:44:01 -070023DTB_NAMES := $(subst $\",,$(CONFIG_BUILD_ARM64_APPENDED_DTB_IMAGE_NAMES))
24ifneq ($(DTB_NAMES),)
25DTB_LIST := $(addsuffix .dtb,$(DTB_NAMES))
Alex Raye2d9f0a2014-03-17 13:44:01 -070026DTB_OBJS := $(addprefix $(obj)/dts/,$(DTB_LIST))
Channagoud Kadabi154584f2016-09-20 12:28:21 -070027else
28DTB_OBJS := $(shell find $(obj)/dts/ -name \*.dtb)
29endif
Alex Raye2d9f0a2014-03-17 13:44:01 -070030
Arun Menon12e1b342017-07-27 10:41:57 -070031# Add RTIC DTB to the DTB list if RTIC MPGen is enabled
32ifdef RTIC_MPGEN
33DTB_OBJS += rtic_mp.dtb
34endif
35
36rtic_mp.dtb: vmlinux FORCE
37 $(RTIC_MPGEN) --objcopy="${OBJCOPY}" --objdump="${OBJDUMP}" \
38 --binpath="" --vmlinux="vmlinux" --config=${KCONFIG_CONFIG} \
39 --cc="${CC}" --dts=rtic_mp.dts && \
40 $(DTC) -O dtb -o rtic_mp.dtb -b 0 $(DTC_FLAGS) rtic_mp.dts
41
Catalin Marinas8c2c3df2012-04-20 14:45:54 +010042$(obj)/Image: vmlinux FORCE
43 $(call if_changed,objcopy)
44
Olof Johansson0723c052015-07-16 21:26:16 +010045$(obj)/Image.bz2: $(obj)/Image FORCE
46 $(call if_changed,bzip2)
47
Atanas Filipovf1d581c2018-04-16 16:14:22 +053048$(obj)/Image-dtb-hdr: $(obj)/Image FORCE
49 echo -n 'UNCOMPRESSED_IMG' > $@ && \
50 $(call size_append, $(filter-out FORCE,$^)) >> $@
51
52$(obj)/Image-dtb: $(obj)/Image-dtb-hdr $(obj)/Image $(DTB_OBJS) FORCE
Haojian Zhuangc0b4d2f2016-04-22 17:23:29 +080053 $(call if_changed,cat)
54
Catalin Marinas8c2c3df2012-04-20 14:45:54 +010055$(obj)/Image.gz: $(obj)/Image FORCE
56 $(call if_changed,gzip)
57
Olof Johansson0723c052015-07-16 21:26:16 +010058$(obj)/Image.lz4: $(obj)/Image FORCE
59 $(call if_changed,lz4)
60
61$(obj)/Image.lzma: $(obj)/Image FORCE
62 $(call if_changed,lzma)
63
64$(obj)/Image.lzo: $(obj)/Image FORCE
65 $(call if_changed,lzo)
66
Alex Raye2d9f0a2014-03-17 13:44:01 -070067$(obj)/Image.gz-dtb: $(obj)/Image.gz $(DTB_OBJS) FORCE
68 $(call if_changed,cat)
69
Masahiro Yamada8684fa32016-02-19 15:05:50 +090070install:
Catalin Marinas8c2c3df2012-04-20 14:45:54 +010071 $(CONFIG_SHELL) $(srctree)/$(src)/install.sh $(KERNELRELEASE) \
72 $(obj)/Image System.map "$(INSTALL_PATH)"
73
Masahiro Yamada8684fa32016-02-19 15:05:50 +090074zinstall:
Catalin Marinas8c2c3df2012-04-20 14:45:54 +010075 $(CONFIG_SHELL) $(srctree)/$(src)/install.sh $(KERNELRELEASE) \
76 $(obj)/Image.gz System.map "$(INSTALL_PATH)"