Merge branch 'batman-adv/merge-oopsonly' of git://git.open-mesh.org/ecsv/linux-merge
[pandora-kernel.git] / arch / microblaze / boot / Makefile
1 #
2 # arch/microblaze/boot/Makefile
3 #
4
5 MKIMAGE := $(srctree)/scripts/mkuboot.sh
6
7 obj-y += linked_dtb.o
8
9 targets := linux.bin linux.bin.gz simpleImage.%
10
11 OBJCOPYFLAGS := -O binary
12
13 # Ensure system.dtb exists
14 $(obj)/linked_dtb.o: $(obj)/system.dtb
15
16 # Generate system.dtb from $(DTB).dtb
17 ifneq ($(DTB),system)
18 $(obj)/system.dtb: $(obj)/$(DTB).dtb
19         $(call if_changed,cp)
20 endif
21
22 $(obj)/linux.bin: vmlinux FORCE
23         $(call if_changed,objcopy)
24         $(call if_changed,uimage)
25         @echo 'Kernel: $@ is ready' ' (#'`cat .version`')'
26
27 $(obj)/linux.bin.gz: $(obj)/linux.bin FORCE
28         $(call if_changed,gzip)
29         @echo 'Kernel: $@ is ready' ' (#'`cat .version`')'
30
31 quiet_cmd_cp = CP      $< $@$2
32         cmd_cp = cat $< >$@$2 || (rm -f $@ && echo false)
33
34 quiet_cmd_strip = STRIP   $@
35         cmd_strip = $(STRIP) -K microblaze_start -K _end -K __log_buf \
36                                 -K _fdt_start vmlinux -o $@
37
38 quiet_cmd_uimage = UIMAGE  $@.ub
39         cmd_uimage = $(CONFIG_SHELL) $(MKIMAGE) -A microblaze -O linux -T kernel \
40                 -C none -n 'Linux-$(KERNELRELEASE)' \
41                 -a $(CONFIG_KERNEL_BASE_ADDR) -e $(CONFIG_KERNEL_BASE_ADDR) \
42                 -d $@ $@.ub
43
44 $(obj)/simpleImage.%: vmlinux FORCE
45         $(call if_changed,cp,.unstrip)
46         $(call if_changed,objcopy)
47         $(call if_changed,uimage)
48         $(call if_changed,strip)
49         @echo 'Kernel: $@ is ready' ' (#'`cat .version`')'
50
51
52 # Rule to build device tree blobs
53 DTC_FLAGS := -p 1024
54
55 $(obj)/%.dtb: $(src)/dts/%.dts FORCE
56         $(call cmd,dtc)
57
58 clean-files += *.dtb simpleImage.*.unstrip linux.bin.ub