blob: 177716b1d61354a74a86ecfff0e08ba522660ec8 [file] [log] [blame]
Linus Torvalds1da177e2005-04-16 15:20:36 -07001#
Hirokazu Takataa556bec2009-11-09 08:51:35 +09002# linux/arch/m32r/boot/compressed/Makefile
Linus Torvalds1da177e2005-04-16 15:20:36 -07003#
4# create a compressed vmlinux image from the original vmlinux
5#
6
Hirokazu Takata337214e2009-10-15 09:21:56 +09007targets := vmlinux vmlinux.bin vmlinux.bin.gz vmlinux.bin.bz2 \
8 vmlinux.bin.lzma head.o misc.o piggy.o vmlinux.lds
Linus Torvalds1da177e2005-04-16 15:20:36 -07009
10OBJECTS = $(obj)/head.o $(obj)/misc.o
11
12#
13# IMAGE_OFFSET is the load offset of the compression loader
14#
15#IMAGE_OFFSET := $(shell printf "0x%08x" $$[$(CONFIG_MEMORY_START)+0x2000])
16#IMAGE_OFFSET := $(shell printf "0x%08x" $$[$(CONFIG_MEMORY_START)+0x00400000])
17
18LDFLAGS_vmlinux := -T
19
20$(obj)/vmlinux: $(obj)/vmlinux.lds $(OBJECTS) $(obj)/piggy.o FORCE
21 $(call if_changed,ld)
22 @:
23
24$(obj)/vmlinux.bin: vmlinux FORCE
25 $(call if_changed,objcopy)
26
27$(obj)/vmlinux.bin.gz: $(obj)/vmlinux.bin FORCE
28 $(call if_changed,gzip)
29
Hirokazu Takata337214e2009-10-15 09:21:56 +090030$(obj)/vmlinux.bin.bz2: $(obj)/vmlinux.bin FORCE
31 $(call if_changed,bzip2)
32
33$(obj)/vmlinux.bin.lzma: $(obj)/vmlinux.bin FORCE
34 $(call if_changed,lzma)
35
Linus Torvalds1da177e2005-04-16 15:20:36 -070036CFLAGS_misc.o += -fpic
37
38ifdef CONFIG_MMU
39LDFLAGS_piggy.o := -r --format binary --oformat elf32-m32r-linux -T
40else
41LDFLAGS_piggy.o := -r --format binary --oformat elf32-m32r -T
42endif
43
44OBJCOPYFLAGS += -R .empty_zero_page
45
Hirokazu Takata337214e2009-10-15 09:21:56 +090046suffix_$(CONFIG_KERNEL_GZIP) = gz
47suffix_$(CONFIG_KERNEL_BZIP2) = bz2
48suffix_$(CONFIG_KERNEL_LZMA) = lzma
49
Hirokazu Takataa556bec2009-11-09 08:51:35 +090050$(obj)/piggy.o: $(obj)/vmlinux.scr $(obj)/vmlinux.bin.$(suffix-y) FORCE
Linus Torvalds1da177e2005-04-16 15:20:36 -070051 $(call if_changed,ld)