2 # linux/arch/x86_64/boot/compressed/Makefile
4 # create a compressed vmlinux image from the original vmlinux
6 # Note all the files here are compiled/linked as 32bit executables.
9 targets
:= vmlinux vmlinux.bin vmlinux.bin.gz head.o misc.o piggy.o
10 EXTRA_AFLAGS
:= -traditional
12 # cannot use EXTRA_CFLAGS because base CFLAGS contains -mkernel which conflicts with
14 CFLAGS
:= -m64
-D__KERNEL__
-Iinclude
-O2
-fno-strict-aliasing
-fPIC
-mcmodel
=small
-fno-builtin
15 LDFLAGS
:= -m elf_x86_64
18 $(obj
)/vmlinux
: $(src
)/vmlinux.lds
$(obj
)/head.o
$(obj
)/misc.o
$(obj
)/piggy.o FORCE
22 $(obj
)/vmlinux.bin
: vmlinux FORCE
23 $(call if_changed
,objcopy
)
25 $(obj
)/vmlinux.bin.gz
: $(obj
)/vmlinux.bin FORCE
26 $(call if_changed
,gzip
)
28 LDFLAGS_piggy.o
:= -r
--format binary
--oformat elf64-x86-64
-T
30 $(obj
)/piggy.o
: $(obj
)/vmlinux.scr
$(obj
)/vmlinux.bin.gz FORCE