1# SPDX-License-Identifier: GPL-2.0-only 2# 3# linux/arch/parisc/boot/compressed/Makefile 4# 5# create a compressed self-extracting vmlinux image from the original vmlinux 6# 7 8KCOV_INSTRUMENT := n 9GCOV_PROFILE := n 10UBSAN_SANITIZE := n 11 12OBJECTS := head.o real2.o firmware.o misc.o piggy.o 13targets := vmlinux.lds vmlinux vmlinux.bin vmlinux.bin.gz vmlinux.bin.bz2 14targets += vmlinux.bin.xz vmlinux.bin.lzma vmlinux.bin.lzo vmlinux.bin.lz4 15targets += $(OBJECTS) sizes.h 16 17KBUILD_CFLAGS := -D__KERNEL__ -O2 -DBOOTLOADER 18KBUILD_CFLAGS += -DDISABLE_BRANCH_PROFILING 19KBUILD_CFLAGS += -fno-strict-aliasing 20KBUILD_CFLAGS += $(cflags-y) -fno-delete-null-pointer-checks -fno-builtin-printf 21KBUILD_CFLAGS += -fno-PIE -mno-space-regs -mdisable-fpregs -Os 22ifndef CONFIG_64BIT 23KBUILD_CFLAGS += -mfast-indirect-calls 24endif 25KBUILD_CFLAGS += -std=gnu11 26 27LDFLAGS_vmlinux := -X -e startup --as-needed -T 28$(obj)/vmlinux: $(obj)/vmlinux.lds $(addprefix $(obj)/, $(OBJECTS)) $(LIBGCC) FORCE 29 $(call if_changed,ld) 30 31sed-sizes := -e 's/^\([0-9a-fA-F]*\) . \(__bss_start\|_end\|parisc_kernel_start\)$$/\#define SZ\2 0x\1/p' 32 33quiet_cmd_sizes = GEN $@ 34 cmd_sizes = $(NM) $< | sed -n $(sed-sizes) > $@ 35 36$(obj)/sizes.h: vmlinux FORCE 37 $(call if_changed,sizes) 38 39AFLAGS_head.o += -I$(objtree)/$(obj) -DBOOTLOADER 40$(obj)/head.o: $(obj)/sizes.h 41 42CFLAGS_misc.o += -I$(objtree)/$(obj) 43$(obj)/misc.o: $(obj)/sizes.h 44 45AFLAGS_real2.o += -DBOOTLOADER 46 47CPPFLAGS_vmlinux.lds += -I$(objtree)/$(obj) -DBOOTLOADER 48$(obj)/vmlinux.lds: $(obj)/sizes.h 49 50OBJCOPYFLAGS_vmlinux.bin := -R .comment -R .note -S 51$(obj)/vmlinux.bin: vmlinux FORCE 52 $(call if_changed,objcopy) 53 54suffix-$(CONFIG_KERNEL_GZIP) := gz 55suffix-$(CONFIG_KERNEL_BZIP2) := bz2 56suffix-$(CONFIG_KERNEL_LZ4) := lz4 57suffix-$(CONFIG_KERNEL_LZMA) := lzma 58suffix-$(CONFIG_KERNEL_LZO) := lzo 59suffix-$(CONFIG_KERNEL_XZ) := xz 60 61$(obj)/vmlinux.bin.gz: $(obj)/vmlinux.bin FORCE 62 $(call if_changed,gzip) 63$(obj)/vmlinux.bin.bz2: $(obj)/vmlinux.bin FORCE 64 $(call if_changed,bzip2_with_size) 65$(obj)/vmlinux.bin.lz4: $(obj)/vmlinux.bin FORCE 66 $(call if_changed,lz4_with_size) 67$(obj)/vmlinux.bin.lzma: $(obj)/vmlinux.bin FORCE 68 $(call if_changed,lzma_with_size) 69$(obj)/vmlinux.bin.lzo: $(obj)/vmlinux.bin FORCE 70 $(call if_changed,lzo_with_size) 71$(obj)/vmlinux.bin.xz: $(obj)/vmlinux.bin FORCE 72 $(call if_changed,xzkern_with_size) 73 74LDFLAGS_piggy.o := -r --format binary --oformat $(LD_BFD) -T 75$(obj)/piggy.o: $(obj)/vmlinux.scr $(obj)/vmlinux.bin.$(suffix-y) FORCE 76 $(call if_changed,ld) 77