Makefile 868 字节
Newer Older
L
Linus Torvalds 已提交
1 2 3 4 5 6
#
# linux/arch/x86_64/boot/compressed/Makefile
#
# create a compressed vmlinux image from the original vmlinux
#

7
targets		:= vmlinux vmlinux.bin vmlinux.bin.gz head_64.o misc_64.o piggy.o
L
Linus Torvalds 已提交
8

9 10 11 12 13
CFLAGS := -m64 -D__KERNEL__ $(LINUXINCLUDE) -O2  \
	  -fno-strict-aliasing -fPIC -mcmodel=small \
	   $(call cc-option, -ffreestanding) \
	   $(call cc-option, -fno-stack-protector)
AFLAGS  := $(CFLAGS) -D__ASSEMBLY__
14
LDFLAGS := -m elf_x86_64
L
Linus Torvalds 已提交
15

16
LDFLAGS_vmlinux := -T
17
$(obj)/vmlinux: $(src)/vmlinux_64.lds $(obj)/head_64.o $(obj)/misc_64.o $(obj)/piggy.o FORCE
L
Linus Torvalds 已提交
18 19 20 21 22 23 24 25 26
	$(call if_changed,ld)
	@:

$(obj)/vmlinux.bin: vmlinux FORCE
	$(call if_changed,objcopy)

$(obj)/vmlinux.bin.gz: $(obj)/vmlinux.bin FORCE
	$(call if_changed,gzip)

27
LDFLAGS_piggy.o := -r --format binary --oformat elf64-x86-64 -T
L
Linus Torvalds 已提交
28

29
$(obj)/piggy.o: $(obj)/vmlinux_64.scr $(obj)/vmlinux.bin.gz FORCE
L
Linus Torvalds 已提交
30
	$(call if_changed,ld)