xref: /OK3568_Linux_fs/kernel/arch/riscv/boot/Makefile (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1*4882a593Smuzhiyun#
2*4882a593Smuzhiyun# arch/riscv/boot/Makefile
3*4882a593Smuzhiyun#
4*4882a593Smuzhiyun# This file is included by the global makefile so that you can add your own
5*4882a593Smuzhiyun# architecture-specific flags and dependencies.
6*4882a593Smuzhiyun#
7*4882a593Smuzhiyun# This file is subject to the terms and conditions of the GNU General Public
8*4882a593Smuzhiyun# License.  See the file "COPYING" in the main directory of this archive
9*4882a593Smuzhiyun# for more details.
10*4882a593Smuzhiyun#
11*4882a593Smuzhiyun# Copyright (C) 2018, Anup Patel.
12*4882a593Smuzhiyun# Author: Anup Patel <anup@brainfault.org>
13*4882a593Smuzhiyun#
14*4882a593Smuzhiyun# Based on the ia64 and arm64 boot/Makefile.
15*4882a593Smuzhiyun#
16*4882a593Smuzhiyun
17*4882a593SmuzhiyunKCOV_INSTRUMENT := n
18*4882a593Smuzhiyun
19*4882a593SmuzhiyunOBJCOPYFLAGS_Image :=-O binary -R .note -R .note.gnu.build-id -R .comment -S
20*4882a593Smuzhiyun
21*4882a593Smuzhiyuntargets := Image loader
22*4882a593Smuzhiyun
23*4882a593Smuzhiyun$(obj)/Image: vmlinux FORCE
24*4882a593Smuzhiyun	$(call if_changed,objcopy)
25*4882a593Smuzhiyun
26*4882a593Smuzhiyun$(obj)/Image.gz: $(obj)/Image FORCE
27*4882a593Smuzhiyun	$(call if_changed,gzip)
28*4882a593Smuzhiyun
29*4882a593Smuzhiyun$(obj)/loader.o: $(src)/loader.S $(obj)/Image
30*4882a593Smuzhiyun
31*4882a593Smuzhiyun$(obj)/loader: $(obj)/loader.o $(obj)/Image $(obj)/loader.lds FORCE
32*4882a593Smuzhiyun	$(Q)$(LD) -T $(obj)/loader.lds -o $@ $(obj)/loader.o
33*4882a593Smuzhiyun
34*4882a593Smuzhiyun$(obj)/Image.bz2: $(obj)/Image FORCE
35*4882a593Smuzhiyun	$(call if_changed,bzip2)
36*4882a593Smuzhiyun
37*4882a593Smuzhiyun$(obj)/Image.lz4: $(obj)/Image FORCE
38*4882a593Smuzhiyun	$(call if_changed,lz4)
39*4882a593Smuzhiyun
40*4882a593Smuzhiyun$(obj)/Image.lzma: $(obj)/Image FORCE
41*4882a593Smuzhiyun	$(call if_changed,lzma)
42*4882a593Smuzhiyun
43*4882a593Smuzhiyun$(obj)/Image.lzo: $(obj)/Image FORCE
44*4882a593Smuzhiyun	$(call if_changed,lzo)
45*4882a593Smuzhiyun
46*4882a593Smuzhiyun$(obj)/loader.bin: $(obj)/loader FORCE
47*4882a593Smuzhiyun	$(call if_changed,objcopy)
48*4882a593Smuzhiyun
49*4882a593Smuzhiyuninstall:
50*4882a593Smuzhiyun	$(CONFIG_SHELL) $(srctree)/$(src)/install.sh $(KERNELRELEASE) \
51*4882a593Smuzhiyun	$(obj)/Image System.map "$(INSTALL_PATH)"
52*4882a593Smuzhiyun
53*4882a593Smuzhiyunzinstall:
54*4882a593Smuzhiyun	$(CONFIG_SHELL) $(srctree)/$(src)/install.sh $(KERNELRELEASE) \
55*4882a593Smuzhiyun	$(obj)/Image.gz System.map "$(INSTALL_PATH)"
56