Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/kaber/nf-next-2.6
[linux-2.6] / arch / sh / boot / compressed / Makefile_32
1 #
2 # linux/arch/sh/boot/compressed/Makefile
3 #
4 # create a compressed vmlinux image from the original vmlinux
5 #
6
7 targets         := vmlinux vmlinux.bin vmlinux.bin.gz \
8                    head_32.o misc_32.o piggy.o
9
10 OBJECTS = $(obj)/head_32.o $(obj)/misc_32.o
11
12 ifdef CONFIG_SH_STANDARD_BIOS
13 OBJECTS += $(obj)/../../kernel/sh_bios.o
14 endif
15
16 #
17 # IMAGE_OFFSET is the load offset of the compression loader
18 #
19 IMAGE_OFFSET    := $(shell /bin/bash -c 'printf "0x%08x" \
20                      $$[$(CONFIG_PAGE_OFFSET)  + \
21                         $(CONFIG_MEMORY_START) + \
22                         $(CONFIG_BOOT_LINK_OFFSET)]')
23
24 LIBGCC  := $(shell $(CC) $(KBUILD_CFLAGS) -print-libgcc-file-name)
25
26 ifeq ($(CONFIG_FUNCTION_TRACER),y)
27 ORIG_CFLAGS := $(KBUILD_CFLAGS)
28 KBUILD_CFLAGS = $(subst -pg, , $(ORIG_CFLAGS))
29 endif
30
31 LDFLAGS_vmlinux := -Ttext $(IMAGE_OFFSET) -e startup -T $(obj)/../../kernel/vmlinux.lds
32
33 $(obj)/vmlinux: $(OBJECTS) $(obj)/piggy.o $(LIBGCC) FORCE
34         $(call if_changed,ld)
35         @:
36
37 $(obj)/vmlinux.bin: vmlinux FORCE
38         $(call if_changed,objcopy)
39
40 $(obj)/vmlinux.bin.gz: $(obj)/vmlinux.bin FORCE
41         $(call if_changed,gzip)
42
43 OBJCOPYFLAGS += -R .empty_zero_page
44
45 $(obj)/piggy.o: $(obj)/piggy.S $(obj)/vmlinux.bin.gz FORCE
46         $(call if_changed,as_o_S)