Commit | Line | Data |
---|---|---|
b2441318 | 1 | # SPDX-License-Identifier: GPL-2.0 |
cfdbc2e1 VG |
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 | |
cfdbc2e1 VG |
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) | |
104058ed VG |
15 | |
16 | suffix-y := bin | |
17 | suffix-$(CONFIG_KERNEL_GZIP) := gz | |
27f3d2a3 | 18 | suffix-$(CONFIG_KERNEL_LZMA) := lzma |
104058ed | 19 | |
27f3d2a3 DM |
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 | |
cfdbc2e1 VG |
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 | ||
27f3d2a3 DM |
34 | $(obj)/vmlinux.bin.lzma: $(obj)/vmlinux.bin FORCE |
35 | $(call if_changed,lzma) | |
36 | ||
104058ed VG |
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) | |
cfdbc2e1 | 42 | |
27f3d2a3 DM |
43 | $(obj)/uImage.lzma: $(obj)/vmlinux.bin.lzma FORCE |
44 | $(call if_changed,uimage,lzma) | |
45 | ||
104058ed VG |
46 | $(obj)/uImage: $(obj)/uImage.$(suffix-y) |
47 | @ln -sf $(notdir $<) $@ | |
48 | @echo ' Image $@ is ready' |