2005-04-17 06:20:36 +08:00
|
|
|
#
|
|
|
|
# linux/arch/i386/boot/compressed/Makefile
|
|
|
|
#
|
|
|
|
# create a compressed vmlinux image from the original vmlinux
|
|
|
|
#
|
|
|
|
|
2007-10-11 17:13:43 +08:00
|
|
|
targets := vmlinux vmlinux.bin vmlinux.bin.gz head_32.o misc_32.o piggy.o \
|
2006-12-07 09:14:04 +08:00
|
|
|
vmlinux.bin.all vmlinux.relocs
|
2005-04-17 06:20:36 +08:00
|
|
|
EXTRA_AFLAGS := -traditional
|
|
|
|
|
2006-12-07 09:14:04 +08:00
|
|
|
LDFLAGS_vmlinux := -T
|
|
|
|
hostprogs-y := relocs
|
2005-04-17 06:20:36 +08:00
|
|
|
|
2007-07-12 03:18:56 +08:00
|
|
|
CFLAGS := -m32 -D__KERNEL__ $(LINUX_INCLUDE) -O2 \
|
|
|
|
-fno-strict-aliasing -fPIC \
|
|
|
|
$(call cc-option,-ffreestanding) \
|
|
|
|
$(call cc-option,-fno-stack-protector)
|
|
|
|
LDFLAGS := -m elf_i386
|
|
|
|
|
2007-10-11 17:13:43 +08:00
|
|
|
$(obj)/vmlinux: $(src)/vmlinux_32.lds $(obj)/head_32.o $(obj)/misc_32.o $(obj)/piggy.o FORCE
|
2005-04-17 06:20:36 +08:00
|
|
|
$(call if_changed,ld)
|
|
|
|
@:
|
|
|
|
|
|
|
|
$(obj)/vmlinux.bin: vmlinux FORCE
|
|
|
|
$(call if_changed,objcopy)
|
|
|
|
|
2006-12-07 09:14:04 +08:00
|
|
|
quiet_cmd_relocs = RELOCS $@
|
2006-12-07 09:14:04 +08:00
|
|
|
cmd_relocs = $(obj)/relocs $< > $@;$(obj)/relocs --abs-relocs $<
|
2006-12-07 09:14:04 +08:00
|
|
|
$(obj)/vmlinux.relocs: vmlinux $(obj)/relocs FORCE
|
|
|
|
$(call if_changed,relocs)
|
|
|
|
|
|
|
|
vmlinux.bin.all-y := $(obj)/vmlinux.bin
|
|
|
|
vmlinux.bin.all-$(CONFIG_RELOCATABLE) += $(obj)/vmlinux.relocs
|
|
|
|
quiet_cmd_relocbin = BUILD $@
|
|
|
|
cmd_relocbin = cat $(filter-out FORCE,$^) > $@
|
|
|
|
$(obj)/vmlinux.bin.all: $(vmlinux.bin.all-y) FORCE
|
|
|
|
$(call if_changed,relocbin)
|
|
|
|
|
|
|
|
ifdef CONFIG_RELOCATABLE
|
|
|
|
$(obj)/vmlinux.bin.gz: $(obj)/vmlinux.bin.all FORCE
|
|
|
|
$(call if_changed,gzip)
|
|
|
|
else
|
2005-04-17 06:20:36 +08:00
|
|
|
$(obj)/vmlinux.bin.gz: $(obj)/vmlinux.bin FORCE
|
|
|
|
$(call if_changed,gzip)
|
2006-12-07 09:14:04 +08:00
|
|
|
endif
|
2005-04-17 06:20:36 +08:00
|
|
|
|
|
|
|
LDFLAGS_piggy.o := -r --format binary --oformat elf32-i386 -T
|
|
|
|
|
2007-10-11 17:13:41 +08:00
|
|
|
$(obj)/piggy.o: $(src)/vmlinux_32.scr $(obj)/vmlinux.bin.gz FORCE
|
2005-04-17 06:20:36 +08:00
|
|
|
$(call if_changed,ld)
|