1ec8f24b7SThomas Gleixner# SPDX-License-Identifier: GPL-2.0-only 22f3c7b81SHelge Deller# 32f3c7b81SHelge Deller# linux/arch/parisc/boot/compressed/Makefile 42f3c7b81SHelge Deller# 52f3c7b81SHelge Deller# create a compressed self-extracting vmlinux image from the original vmlinux 62f3c7b81SHelge Deller# 72f3c7b81SHelge Deller 82f3c7b81SHelge DellerKCOV_INSTRUMENT := n 92f3c7b81SHelge DellerGCOV_PROFILE := n 102f3c7b81SHelge DellerUBSAN_SANITIZE := n 112f3c7b81SHelge Deller 126f21e734SMasahiro YamadaOBJECTS := head.o real2.o firmware.o misc.o piggy.o 132f3c7b81SHelge Dellertargets := vmlinux.lds vmlinux vmlinux.bin vmlinux.bin.gz vmlinux.bin.bz2 142f3c7b81SHelge Dellertargets += vmlinux.bin.xz vmlinux.bin.lzma vmlinux.bin.lzo vmlinux.bin.lz4 156f21e734SMasahiro Yamadatargets += $(OBJECTS) sizes.h 162f3c7b81SHelge Deller 172f3c7b81SHelge DellerKBUILD_CFLAGS := -D__KERNEL__ -O2 -DBOOTLOADER 182f3c7b81SHelge DellerKBUILD_CFLAGS += -DDISABLE_BRANCH_PROFILING 193fd84a4fSArnd BergmannKBUILD_CFLAGS += -fno-strict-aliasing 2034c201aeSHelge DellerKBUILD_CFLAGS += $(cflags-y) -fno-delete-null-pointer-checks -fno-builtin-printf 218c031ba6SHelge DellerKBUILD_CFLAGS += -fno-PIE -mno-space-regs -mdisable-fpregs -Os 222f3c7b81SHelge Dellerifndef CONFIG_64BIT 232f3c7b81SHelge DellerKBUILD_CFLAGS += -mfast-indirect-calls 242f3c7b81SHelge Dellerendif 252f3c7b81SHelge Deller 262f3c7b81SHelge DellerLDFLAGS_vmlinux := -X -e startup --as-needed -T 276f21e734SMasahiro Yamada$(obj)/vmlinux: $(obj)/vmlinux.lds $(addprefix $(obj)/, $(OBJECTS)) $(LIBGCC) FORCE 282f3c7b81SHelge Deller $(call if_changed,ld) 292f3c7b81SHelge Deller 302f3c7b81SHelge Dellersed-sizes := -e 's/^\([0-9a-fA-F]*\) . \(__bss_start\|_end\|parisc_kernel_start\)$$/\#define SZ\2 0x\1/p' 312f3c7b81SHelge Deller 322f3c7b81SHelge Dellerquiet_cmd_sizes = GEN $@ 332f3c7b81SHelge Deller cmd_sizes = $(NM) $< | sed -n $(sed-sizes) > $@ 342f3c7b81SHelge Deller 353da6379aSHelge Deller$(obj)/sizes.h: vmlinux FORCE 362f3c7b81SHelge Deller $(call if_changed,sizes) 372f3c7b81SHelge Deller 382f3c7b81SHelge DellerAFLAGS_head.o += -I$(objtree)/$(obj) -DBOOTLOADER 392f3c7b81SHelge Deller$(obj)/head.o: $(obj)/sizes.h 402f3c7b81SHelge Deller 412f3c7b81SHelge DellerCFLAGS_misc.o += -I$(objtree)/$(obj) 422f3c7b81SHelge Deller$(obj)/misc.o: $(obj)/sizes.h 432f3c7b81SHelge Deller 442f3c7b81SHelge DellerAFLAGS_real2.o += -DBOOTLOADER 452f3c7b81SHelge Deller 462f3c7b81SHelge DellerCPPFLAGS_vmlinux.lds += -I$(objtree)/$(obj) -DBOOTLOADER 472f3c7b81SHelge Deller$(obj)/vmlinux.lds: $(obj)/sizes.h 482f3c7b81SHelge Deller 49e50beea8SHelge DellerOBJCOPYFLAGS_vmlinux.bin := -R .comment -R .note -S 50e50beea8SHelge Deller$(obj)/vmlinux.bin: vmlinux FORCE 512f3c7b81SHelge Deller $(call if_changed,objcopy) 522f3c7b81SHelge Deller 532f3c7b81SHelge Dellersuffix-$(CONFIG_KERNEL_GZIP) := gz 542f3c7b81SHelge Dellersuffix-$(CONFIG_KERNEL_BZIP2) := bz2 552f3c7b81SHelge Dellersuffix-$(CONFIG_KERNEL_LZ4) := lz4 562f3c7b81SHelge Dellersuffix-$(CONFIG_KERNEL_LZMA) := lzma 572f3c7b81SHelge Dellersuffix-$(CONFIG_KERNEL_LZO) := lzo 582f3c7b81SHelge Dellersuffix-$(CONFIG_KERNEL_XZ) := xz 592f3c7b81SHelge Deller 60*53e7b5dfSMasahiro Yamada$(obj)/vmlinux.bin.gz: $(obj)/vmlinux.bin FORCE 612f3c7b81SHelge Deller $(call if_changed,gzip) 62*53e7b5dfSMasahiro Yamada$(obj)/vmlinux.bin.bz2: $(obj)/vmlinux.bin FORCE 637ce7e984SMasahiro Yamada $(call if_changed,bzip2_with_size) 64*53e7b5dfSMasahiro Yamada$(obj)/vmlinux.bin.lz4: $(obj)/vmlinux.bin FORCE 657ce7e984SMasahiro Yamada $(call if_changed,lz4_with_size) 66*53e7b5dfSMasahiro Yamada$(obj)/vmlinux.bin.lzma: $(obj)/vmlinux.bin FORCE 677ce7e984SMasahiro Yamada $(call if_changed,lzma_with_size) 68*53e7b5dfSMasahiro Yamada$(obj)/vmlinux.bin.lzo: $(obj)/vmlinux.bin FORCE 697ce7e984SMasahiro Yamada $(call if_changed,lzo_with_size) 70*53e7b5dfSMasahiro Yamada$(obj)/vmlinux.bin.xz: $(obj)/vmlinux.bin FORCE 717ce7e984SMasahiro Yamada $(call if_changed,xzkern_with_size) 722f3c7b81SHelge Deller 732f3c7b81SHelge DellerLDFLAGS_piggy.o := -r --format binary --oformat $(LD_BFD) -T 743da6379aSHelge Deller$(obj)/piggy.o: $(obj)/vmlinux.scr $(obj)/vmlinux.bin.$(suffix-y) FORCE 752f3c7b81SHelge Deller $(call if_changed,ld) 76