Merge tag 'modules-for-v4.15' of git://git.kernel.org/pub/scm/linux/kernel/git/jeyu...
[sfrench/cifs-2.6.git] / arch / arc / boot / Makefile
1 # SPDX-License-Identifier: GPL-2.0
2 targets := vmlinux.bin vmlinux.bin.gz uImage
3
4 # uImage build relies on mkimage being availble on your host for ARC target
5 # You will need to build u-boot for ARC, rename mkimage to arc-elf32-mkimage
6 # and make sure it's reacable from your PATH
7
8 OBJCOPYFLAGS= -O binary -R .note -R .note.gnu.build-id -R .comment -S
9
10 LINUX_START_TEXT = $$(readelf -h vmlinux | \
11                         grep "Entry point address" | grep -o 0x.*)
12
13 UIMAGE_LOADADDR    = $(CONFIG_LINUX_LINK_BASE)
14 UIMAGE_ENTRYADDR   = $(LINUX_START_TEXT)
15
16 suffix-y := bin
17 suffix-$(CONFIG_KERNEL_GZIP)    := gz
18 suffix-$(CONFIG_KERNEL_LZMA)    := lzma
19
20 targets += uImage
21 targets += uImage.bin
22 targets += uImage.gz
23 targets += uImage.lzma
24 extra-y += vmlinux.bin
25 extra-y += vmlinux.bin.gz
26 extra-y += vmlinux.bin.lzma
27
28 $(obj)/vmlinux.bin: vmlinux FORCE
29         $(call if_changed,objcopy)
30
31 $(obj)/vmlinux.bin.gz: $(obj)/vmlinux.bin FORCE
32         $(call if_changed,gzip)
33
34 $(obj)/vmlinux.bin.lzma: $(obj)/vmlinux.bin FORCE
35         $(call if_changed,lzma)
36
37 $(obj)/uImage.bin: $(obj)/vmlinux.bin FORCE
38         $(call if_changed,uimage,none)
39
40 $(obj)/uImage.gz: $(obj)/vmlinux.bin.gz FORCE
41         $(call if_changed,uimage,gzip)
42
43 $(obj)/uImage.lzma: $(obj)/vmlinux.bin.lzma FORCE
44         $(call if_changed,uimage,lzma)
45
46 $(obj)/uImage: $(obj)/uImage.$(suffix-y)
47         @ln -sf $(notdir $<) $@
48         @echo '  Image $@ is ready'