1 # SPDX-License-Identifier: GPL-2.0-only
3 # linux/arch/parisc/boot/compressed/Makefile
5 # create a compressed self-extracting vmlinux image from the original vmlinux
12 targets
:= vmlinux.lds vmlinux vmlinux.bin vmlinux.bin.gz vmlinux.bin.bz2
13 targets
+= vmlinux.bin.xz vmlinux.bin.lzma vmlinux.bin.lzo vmlinux.bin.lz4
14 targets
+= misc.o piggy.o sizes.h head.o real2.o firmware.o
15 targets
+= real2.S firmware.c
17 KBUILD_CFLAGS
:= -D__KERNEL__
-O2
-DBOOTLOADER
18 KBUILD_CFLAGS
+= -DDISABLE_BRANCH_PROFILING
19 KBUILD_CFLAGS
+= -fno-strict-aliasing
20 KBUILD_CFLAGS
+= $(cflags-y
) -fno-delete-null-pointer-checks
-fno-builtin-printf
21 KBUILD_CFLAGS
+= -fno-PIE
-mno-space-regs
-mdisable-fpregs
-Os
23 KBUILD_CFLAGS
+= -mfast-indirect-calls
26 OBJECTS
+= $(obj
)/head.o
$(obj
)/real2.o
$(obj
)/firmware.o
$(obj
)/misc.o
$(obj
)/piggy.o
28 LDFLAGS_vmlinux
:= -X
-e startup
--as-needed
-T
29 $(obj
)/vmlinux
: $(obj
)/vmlinux.lds
$(OBJECTS
) $(LIBGCC
)
32 sed-sizes
:= -e
's/^\([0-9a-fA-F]*\) . \(__bss_start\|_end\|parisc_kernel_start\)$$/\#define SZ\2 0x\1/p'
34 quiet_cmd_sizes
= GEN
$@
35 cmd_sizes
= $(NM
) $< | sed
-n
$(sed-sizes
) > $@
37 $(obj
)/sizes.h
: vmlinux
38 $(call if_changed
,sizes
)
40 AFLAGS_head.o
+= -I
$(objtree
)/$(obj
) -DBOOTLOADER
41 $(obj
)/head.o
: $(obj
)/sizes.h
43 CFLAGS_misc.o
+= -I
$(objtree
)/$(obj
)
44 $(obj
)/misc.o
: $(obj
)/sizes.h
46 $(obj
)/firmware.o
: $(obj
)/firmware.c
47 $(obj
)/firmware.c
: $(srctree
)/arch
/$(SRCARCH
)/kernel
/firmware.c
50 AFLAGS_real2.o
+= -DBOOTLOADER
51 $(obj
)/real2.o
: $(obj
)/real2.S
52 $(obj
)/real2.S
: $(srctree
)/arch
/$(SRCARCH
)/kernel
/real2.S
55 $(obj
)/misc.o
: $(obj
)/sizes.h
57 CPPFLAGS_vmlinux.lds
+= -I
$(objtree
)/$(obj
) -DBOOTLOADER
58 $(obj
)/vmlinux.lds
: $(obj
)/sizes.h
60 OBJCOPYFLAGS_vmlinux.bin
:= -R .comment
-R .note
-S
61 $(obj
)/vmlinux.bin
: vmlinux FORCE
62 $(call if_changed
,objcopy
)
64 vmlinux.bin.all-y
:= $(obj
)/vmlinux.bin
66 suffix-
$(CONFIG_KERNEL_GZIP
) := gz
67 suffix-
$(CONFIG_KERNEL_BZIP2
) := bz2
68 suffix-
$(CONFIG_KERNEL_LZ4
) := lz4
69 suffix-
$(CONFIG_KERNEL_LZMA
) := lzma
70 suffix-
$(CONFIG_KERNEL_LZO
) := lzo
71 suffix-
$(CONFIG_KERNEL_XZ
) := xz
73 $(obj
)/vmlinux.bin.gz
: $(vmlinux.bin.all-y
)
74 $(call if_changed
,gzip
)
75 $(obj
)/vmlinux.bin.bz2
: $(vmlinux.bin.all-y
)
76 $(call if_changed
,bzip2
)
77 $(obj
)/vmlinux.bin.lz4
: $(vmlinux.bin.all-y
)
78 $(call if_changed
,lz4
)
79 $(obj
)/vmlinux.bin.lzma
: $(vmlinux.bin.all-y
)
80 $(call if_changed
,lzma
)
81 $(obj
)/vmlinux.bin.lzo
: $(vmlinux.bin.all-y
)
82 $(call if_changed
,lzo
)
83 $(obj
)/vmlinux.bin.xz
: $(vmlinux.bin.all-y
)
84 $(call if_changed
,xzkern
)
86 LDFLAGS_piggy.o
:= -r
--format binary
--oformat
$(LD_BFD
) -T
87 $(obj
)/piggy.o
: $(obj
)/vmlinux.scr
$(obj
)/vmlinux.bin.
$(suffix-y
)