Merge branch 'for-linus' of git://git.infradead.org/ubi-2.6
[deliverable/linux.git] / arch / sh / boot / compressed / Makefile
CommitLineData
1eca133c
PM
1#
2# linux/arch/sh/boot/compressed/Makefile
3#
4# create a compressed vmlinux image from the original vmlinux
5#
6
7targets := vmlinux vmlinux.bin vmlinux.bin.gz \
07e88e1b 8 vmlinux.bin.bz2 vmlinux.bin.lzma \
50cfa79d 9 vmlinux.bin.xz vmlinux.bin.lzo \
59f00296 10 head_$(BITS).o misc.o piggy.o
1eca133c 11
59f00296 12OBJECTS = $(obj)/head_$(BITS).o $(obj)/misc.o $(obj)/cache.o
1eca133c 13
1eca133c
PM
14#
15# IMAGE_OFFSET is the load offset of the compression loader
16#
9c3d9363
MF
17ifeq ($(CONFIG_32BIT),y)
18IMAGE_OFFSET := $(shell /bin/bash -c 'printf "0x%08x" \
19 $$[$(CONFIG_MEMORY_START) + \
20 $(CONFIG_BOOT_LINK_OFFSET)]')
21else
1eca133c
PM
22IMAGE_OFFSET := $(shell /bin/bash -c 'printf "0x%08x" \
23 $$[$(CONFIG_PAGE_OFFSET) + \
24 $(KERNEL_MEMORY) + \
25 $(CONFIG_BOOT_LINK_OFFSET)]')
9c3d9363 26endif
1eca133c
PM
27
28LIBGCC := $(shell $(CC) $(KBUILD_CFLAGS) -print-libgcc-file-name)
29
473d1cf4 30ifeq ($(CONFIG_MCOUNT),y)
1eca133c
PM
31ORIG_CFLAGS := $(KBUILD_CFLAGS)
32KBUILD_CFLAGS = $(subst -pg, , $(ORIG_CFLAGS))
33endif
34
35LDFLAGS_vmlinux := --oformat $(ld-bfd) -Ttext $(IMAGE_OFFSET) -e startup \
36 -T $(obj)/../../kernel/vmlinux.lds
37
38$(obj)/vmlinux: $(OBJECTS) $(obj)/piggy.o $(LIBGCC) FORCE
39 $(call if_changed,ld)
40 @:
41
42$(obj)/vmlinux.bin: vmlinux FORCE
43 $(call if_changed,objcopy)
44
07e88e1b
PM
45vmlinux.bin.all-y := $(obj)/vmlinux.bin
46
47$(obj)/vmlinux.bin.gz: $(vmlinux.bin.all-y) FORCE
1eca133c 48 $(call if_changed,gzip)
07e88e1b
PM
49$(obj)/vmlinux.bin.bz2: $(vmlinux.bin.all-y) FORCE
50 $(call if_changed,bzip2)
51$(obj)/vmlinux.bin.lzma: $(vmlinux.bin.all-y) FORCE
52 $(call if_changed,lzma)
50cfa79d
PM
53$(obj)/vmlinux.bin.xz: $(vmlinux.bin.all-y) FORCE
54 $(call if_changed,xzkern)
c7b16efb
PM
55$(obj)/vmlinux.bin.lzo: $(vmlinux.bin.all-y) FORCE
56 $(call if_changed,lzo)
07e88e1b 57
1eca133c
PM
58OBJCOPYFLAGS += -R .empty_zero_page
59
07e88e1b
PM
60LDFLAGS_piggy.o := -r --format binary --oformat $(ld-bfd) -T
61
62$(obj)/piggy.o: $(obj)/vmlinux.scr $(obj)/vmlinux.bin.$(suffix-y) FORCE
63 $(call if_changed,ld)
This page took 0.114836 seconds and 5 git commands to generate.