1 # SPDX-License-Identifier: GPL-2.0
3 # linux/arch/sh/boot/compressed/Makefile
5 # create a compressed vmlinux image from the original vmlinux
8 targets
:= vmlinux vmlinux.bin vmlinux.bin.gz head.o misc.o piggy.o
10 OBJECTS
= $(obj
)/head.o
$(obj
)/misc.o
13 # IMAGE_OFFSET is the load offset of the compression loader
14 # Assign dummy values if these 2 variables are not defined,
15 # in order to suppress error message.
17 CONFIG_MEMORY_START ?
= 0x00400000
18 CONFIG_BOOT_LINK_OFFSET ?
= 0x00280000
19 IMAGE_OFFSET
:= $(shell printf
"0x%08x" $$(($(CONFIG_MEMORY_START
)+$(CONFIG_BOOT_LINK_OFFSET
))))
21 LIBGCC
:= $(shell $(CROSS-COMPILE
)$(CC
) $(KBUILD_CFLAGS
) -print-libgcc-file-name
2>/dev
/null
)
22 LDFLAGS_vmlinux
:= -Ttext
$(IMAGE_OFFSET
) -estartup
-T
$(obj
)/vmlinux.lds \
23 --defsym output
=$(CONFIG_MEMORY_START
)
25 $(obj
)/vmlinux
: $(OBJECTS
) $(obj
)/piggy.o
$(LIBGCC
) FORCE
28 $(obj
)/vmlinux.bin
: vmlinux FORCE
29 $(call if_changed
,objcopy
)
31 suffix-
$(CONFIG_KERNEL_GZIP
) := gzip
32 suffix-
$(CONFIG_KERNEL_LZO
) := lzo
34 $(obj
)/vmlinux.bin.
$(suffix-y
): $(obj
)/vmlinux.bin FORCE
35 $(call if_changed
,$(suffix-y
))
37 LDFLAGS_piggy.o
:= -r
--format binary
--oformat elf32-h8300-linux
-T
38 OBJCOPYFLAGS
:= -O binary
40 $(obj
)/piggy.o
: $(obj
)/vmlinux.scr
$(obj
)/vmlinux.bin.
$(suffix-y
) FORCE