xref: /openbmc/linux/arch/nios2/boot/compressed/Makefile (revision 498495dba268b20e8eadd7fe93c140c68b6cc9d2)
1*b2441318SGreg Kroah-Hartman# SPDX-License-Identifier: GPL-2.0
201623627SLey Foon Tan#
301623627SLey Foon Tan# create a compressed vmlinux image from the original vmlinux
401623627SLey Foon Tan#
501623627SLey Foon Tan
601623627SLey Foon Tantargets		:= vmlinux head.o misc.o piggy.o vmlinux.lds
701623627SLey Foon Tanasflags-y	:=
801623627SLey Foon Tan
901623627SLey Foon TanOBJECTS = $(obj)/head.o $(obj)/misc.o
1001623627SLey Foon Tan
1101623627SLey Foon TanLDFLAGS_vmlinux := -T
1201623627SLey Foon Tan
1301623627SLey Foon Tan$(obj)/vmlinux: $(obj)/vmlinux.lds $(OBJECTS) $(obj)/piggy.o FORCE
1401623627SLey Foon Tan	$(call if_changed,ld)
1501623627SLey Foon Tan
1601623627SLey Foon TanLDFLAGS_piggy.o := -r --format binary --oformat elf32-littlenios2 -T
1701623627SLey Foon Tan
1801623627SLey Foon Tan$(obj)/piggy.o: $(obj)/vmlinux.scr $(obj)/../vmlinux.gz FORCE
1901623627SLey Foon Tan	$(call if_changed,ld)
20