GNU Linux-libre 4.9.333-gnu1
[releases.git] / arch / m32r / boot / compressed / Makefile
1 #
2 # linux/arch/m32r/boot/compressed/Makefile
3 #
4 # create a compressed vmlinux image from the original vmlinux
5 #
6
7 targets         := vmlinux vmlinux.bin vmlinux.bin.gz vmlinux.bin.bz2 \
8                    vmlinux.bin.lzma head.o misc.o piggy.o vmlinux.lds
9
10 OBJECTS = $(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
18 LDFLAGS_vmlinux := -T
19
20 $(obj)/vmlinux: $(obj)/vmlinux.lds $(OBJECTS) $(obj)/piggy.o FORCE
21         $(call if_changed,ld)
22
23 $(obj)/vmlinux.bin: vmlinux FORCE
24         $(call if_changed,objcopy)
25
26 $(obj)/vmlinux.bin.gz: $(obj)/vmlinux.bin FORCE
27         $(call if_changed,gzip)
28
29 $(obj)/vmlinux.bin.bz2: $(obj)/vmlinux.bin FORCE
30         $(call if_changed,bzip2)
31
32 $(obj)/vmlinux.bin.lzma: $(obj)/vmlinux.bin FORCE
33         $(call if_changed,lzma)
34
35 CFLAGS_misc.o += -fpic
36
37 ifdef CONFIG_MMU
38 LDFLAGS_piggy.o := -r --format binary --oformat elf32-m32r-linux -T
39 else
40 LDFLAGS_piggy.o := -r --format binary --oformat elf32-m32r -T
41 endif
42
43 OBJCOPYFLAGS += -R .empty_zero_page
44
45 suffix-$(CONFIG_KERNEL_GZIP)    = gz
46 suffix-$(CONFIG_KERNEL_BZIP2)   = bz2
47 suffix-$(CONFIG_KERNEL_LZMA)    = lzma
48
49 $(obj)/piggy.o: $(obj)/vmlinux.scr $(obj)/vmlinux.bin.$(suffix-y) FORCE
50         $(call if_changed,ld)