2 # linux/arch/parisc/boot/compressed/Makefile
4 # create a compressed self-extracting vmlinux image from the original vmlinux
11 targets
:= vmlinux.lds vmlinux vmlinux.bin vmlinux.bin.gz vmlinux.bin.bz2
12 targets
+= vmlinux.bin.xz vmlinux.bin.lzma vmlinux.bin.lzo vmlinux.bin.lz4
13 targets
+= misc.o piggy.o sizes.h head.o real2.o firmware.o
15 KBUILD_CFLAGS
:= -D__KERNEL__
-O2
-DBOOTLOADER
16 KBUILD_CFLAGS
+= -DDISABLE_BRANCH_PROFILING
17 KBUILD_CFLAGS
+= $(cflags-y
) -fno-delete-null-pointer-checks
18 KBUILD_CFLAGS
+= -fno-PIE
-mno-space-regs
-mdisable-fpregs
-Os
20 KBUILD_CFLAGS
+= -mfast-indirect-calls
23 OBJECTS
+= $(obj
)/head.o
$(obj
)/real2.o
$(obj
)/firmware.o
$(obj
)/misc.o
$(obj
)/piggy.o
25 # LDFLAGS_vmlinux := -X --whole-archive -e startup -T
26 LDFLAGS_vmlinux
:= -X
-e startup
--as-needed
-T
27 $(obj
)/vmlinux
: $(obj
)/vmlinux.lds
$(OBJECTS
) $(LIBGCC
)
30 sed-sizes
:= -e
's/^\([0-9a-fA-F]*\) . \(__bss_start\|_end\|parisc_kernel_start\)$$/\#define SZ\2 0x\1/p'
32 quiet_cmd_sizes
= GEN
$@
33 cmd_sizes
= $(NM
) $< | sed
-n
$(sed-sizes
) > $@
35 $(obj
)/sizes.h
: vmlinux
36 $(call if_changed
,sizes
)
38 AFLAGS_head.o
+= -I
$(objtree
)/$(obj
) -DBOOTLOADER
39 $(obj
)/head.o
: $(obj
)/sizes.h
41 CFLAGS_misc.o
+= -I
$(objtree
)/$(obj
)
42 $(obj
)/misc.o
: $(obj
)/sizes.h
44 $(obj
)/firmware.o
: $(obj
)/firmware.c
45 $(obj
)/firmware.c
: $(srctree
)/arch
/$(SRCARCH
)/kernel
/firmware.c
48 AFLAGS_real2.o
+= -DBOOTLOADER
49 $(obj
)/real2.o
: $(obj
)/real2.S
50 $(obj
)/real2.S
: $(srctree
)/arch
/$(SRCARCH
)/kernel
/real2.S
53 $(obj
)/misc.o
: $(obj
)/sizes.h
55 CPPFLAGS_vmlinux.lds
+= -I
$(objtree
)/$(obj
) -DBOOTLOADER
56 $(obj
)/vmlinux.lds
: $(obj
)/sizes.h
58 OBJCOPYFLAGS_vmlinux.bin
:= -O binary
-R .comment
-S
59 $(obj
)/vmlinux.bin
: vmlinux
60 $(call if_changed
,objcopy
)
62 vmlinux.bin.all-y
:= $(obj
)/vmlinux.bin
64 suffix-
$(CONFIG_KERNEL_GZIP
) := gz
65 suffix-
$(CONFIG_KERNEL_BZIP2
) := bz2
66 suffix-
$(CONFIG_KERNEL_LZ4
) := lz4
67 suffix-
$(CONFIG_KERNEL_LZMA
) := lzma
68 suffix-
$(CONFIG_KERNEL_LZO
) := lzo
69 suffix-
$(CONFIG_KERNEL_XZ
) := xz
71 $(obj
)/vmlinux.bin.gz
: $(vmlinux.bin.all-y
)
72 $(call if_changed
,gzip
)
73 $(obj
)/vmlinux.bin.bz2
: $(vmlinux.bin.all-y
)
74 $(call if_changed
,bzip2
)
75 $(obj
)/vmlinux.bin.lz4
: $(vmlinux.bin.all-y
)
76 $(call if_changed
,lz4
)
77 $(obj
)/vmlinux.bin.lzma
: $(vmlinux.bin.all-y
)
78 $(call if_changed
,lzma
)
79 $(obj
)/vmlinux.bin.lzo
: $(vmlinux.bin.all-y
)
80 $(call if_changed
,lzo
)
81 $(obj
)/vmlinux.bin.xz
: $(vmlinux.bin.all-y
)
82 $(call if_changed
,xzkern
)
84 LDFLAGS_piggy.o
:= -r
--format binary
--oformat
$(LD_BFD
) -T
85 $(obj
)/piggy.o
: $(obj
)/vmlinux.scr
$(obj
)/vmlinux.bin.
$(suffix-y
)