Merge branches 'sh/compressors' and 'sh/ftrace'
[linux-2.6/linux-acpi-2.6/ibm-acpi-2.6.git] / arch / sh / boot / compressed / Makefile
blob59e2937caa2fb5a57f1e9d512d304be57dbbf294
2 # linux/arch/sh/boot/compressed/Makefile
4 # create a compressed vmlinux image from the original vmlinux
7 targets := vmlinux vmlinux.bin vmlinux.bin.gz \
8 vmlinux.bin.bz2 vmlinux.bin.lzma \
9 head_$(BITS).o misc.o piggy.o
11 OBJECTS = $(obj)/head_$(BITS).o $(obj)/misc.o $(obj)/cache.o
13 ifdef CONFIG_SH_STANDARD_BIOS
14 OBJECTS += $(obj)/../../kernel/sh_bios.o
15 endif
18 # IMAGE_OFFSET is the load offset of the compression loader
20 IMAGE_OFFSET := $(shell /bin/bash -c 'printf "0x%08x" \
21 $$[$(CONFIG_PAGE_OFFSET) + \
22 $(KERNEL_MEMORY) + \
23 $(CONFIG_BOOT_LINK_OFFSET)]')
25 LIBGCC := $(shell $(CC) $(KBUILD_CFLAGS) -print-libgcc-file-name)
27 ifeq ($(CONFIG_MCOUNT),y)
28 ORIG_CFLAGS := $(KBUILD_CFLAGS)
29 KBUILD_CFLAGS = $(subst -pg, , $(ORIG_CFLAGS))
30 endif
32 LDFLAGS_vmlinux := --oformat $(ld-bfd) -Ttext $(IMAGE_OFFSET) -e startup \
33 -T $(obj)/../../kernel/vmlinux.lds
35 $(obj)/vmlinux: $(OBJECTS) $(obj)/piggy.o $(LIBGCC) FORCE
36 $(call if_changed,ld)
39 $(obj)/vmlinux.bin: vmlinux FORCE
40 $(call if_changed,objcopy)
42 vmlinux.bin.all-y := $(obj)/vmlinux.bin
44 $(obj)/vmlinux.bin.gz: $(vmlinux.bin.all-y) FORCE
45 $(call if_changed,gzip)
46 $(obj)/vmlinux.bin.bz2: $(vmlinux.bin.all-y) FORCE
47 $(call if_changed,bzip2)
48 $(obj)/vmlinux.bin.lzma: $(vmlinux.bin.all-y) FORCE
49 $(call if_changed,lzma)
51 suffix-$(CONFIG_KERNEL_GZIP) := gz
52 suffix-$(CONFIG_KERNEL_BZIP2) := bz2
53 suffix-$(CONFIG_KERNEL_LZMA) := lzma
55 OBJCOPYFLAGS += -R .empty_zero_page
57 LDFLAGS_piggy.o := -r --format binary --oformat $(ld-bfd) -T
59 $(obj)/piggy.o: $(obj)/vmlinux.scr $(obj)/vmlinux.bin.$(suffix-y) FORCE
60 $(call if_changed,ld)