Michal Simek | 5f8ffb5 | 2009-03-27 14:25:51 +0100 | [diff] [blame] | 1 | # |
| 2 | # arch/microblaze/boot/Makefile |
| 3 | # |
| 4 | |
Michal Simek | 6a8dfe1 | 2009-10-14 17:38:26 +0200 | [diff] [blame] | 5 | MKIMAGE := $(srctree)/scripts/mkuboot.sh |
| 6 | |
Michal Simek | f05131c | 2009-09-14 15:15:49 +0200 | [diff] [blame] | 7 | obj-y += linked_dtb.o |
| 8 | |
| 9 | targets := linux.bin linux.bin.gz simpleImage.% |
Michal Simek | 5f8ffb5 | 2009-03-27 14:25:51 +0100 | [diff] [blame] | 10 | |
Michal Simek | 6a8dfe1 | 2009-10-14 17:38:26 +0200 | [diff] [blame] | 11 | OBJCOPYFLAGS := -O binary |
Michal Simek | 5f8ffb5 | 2009-03-27 14:25:51 +0100 | [diff] [blame] | 12 | |
Michal Simek | f05131c | 2009-09-14 15:15:49 +0200 | [diff] [blame] | 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 | |
Michal Simek | 5f8ffb5 | 2009-03-27 14:25:51 +0100 | [diff] [blame] | 22 | $(obj)/linux.bin: vmlinux FORCE |
Michal Simek | 5f8ffb5 | 2009-03-27 14:25:51 +0100 | [diff] [blame] | 23 | $(call if_changed,objcopy) |
Michal Simek | 6a8dfe1 | 2009-10-14 17:38:26 +0200 | [diff] [blame] | 24 | $(call if_changed,uimage) |
Michal Simek | 5f8ffb5 | 2009-03-27 14:25:51 +0100 | [diff] [blame] | 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 | |
Michal Simek | f05131c | 2009-09-14 15:15:49 +0200 | [diff] [blame] | 31 | quiet_cmd_cp = CP $< $@$2 |
| 32 | cmd_cp = cat $< >$@$2 || (rm -f $@ && echo false) |
| 33 | |
| 34 | quiet_cmd_strip = STRIP $@ |
Michal Simek | ca28b51 | 2010-07-28 09:29:11 +0200 | [diff] [blame] | 35 | cmd_strip = $(STRIP) -K microblaze_start -K _end -K __log_buf \ |
Michal Simek | 61b403a | 2010-07-28 07:58:06 +0200 | [diff] [blame] | 36 | -K _fdt_start vmlinux -o $@ |
Michal Simek | f05131c | 2009-09-14 15:15:49 +0200 | [diff] [blame] | 37 | |
Michal Simek | 6a8dfe1 | 2009-10-14 17:38:26 +0200 | [diff] [blame] | 38 | quiet_cmd_uimage = UIMAGE $@.ub |
Michal Simek | 61b403a | 2010-07-28 07:58:06 +0200 | [diff] [blame] | 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 |
Michal Simek | 6a8dfe1 | 2009-10-14 17:38:26 +0200 | [diff] [blame] | 43 | |
Michal Simek | f05131c | 2009-09-14 15:15:49 +0200 | [diff] [blame] | 44 | $(obj)/simpleImage.%: vmlinux FORCE |
| 45 | $(call if_changed,cp,.unstrip) |
Michal Simek | 6a8dfe1 | 2009-10-14 17:38:26 +0200 | [diff] [blame] | 46 | $(call if_changed,objcopy) |
| 47 | $(call if_changed,uimage) |
Michal Simek | f05131c | 2009-09-14 15:15:49 +0200 | [diff] [blame] | 48 | $(call if_changed,strip) |
| 49 | @echo 'Kernel: $@ is ready' ' (#'`cat .version`')' |
| 50 | |
Michal Simek | f05131c | 2009-09-14 15:15:49 +0200 | [diff] [blame] | 51 | |
| 52 | # Rule to build device tree blobs |
Dirk Brandewie | 710fc04 | 2010-12-22 11:57:29 -0800 | [diff] [blame] | 53 | DTC_FLAGS := -p 1024 |
Michal Simek | f05131c | 2009-09-14 15:15:49 +0200 | [diff] [blame] | 54 | |
Dirk Brandewie | 710fc04 | 2010-12-22 11:57:29 -0800 | [diff] [blame] | 55 | $(obj)/%.dtb: $(src)/dts/%.dts FORCE |
| 56 | $(call cmd,dtc) |
Michal Simek | f05131c | 2009-09-14 15:15:49 +0200 | [diff] [blame] | 57 | |
Arun Bhanu | 8a8804f | 2010-03-17 16:06:03 +0800 | [diff] [blame] | 58 | clean-files += *.dtb simpleImage.*.unstrip linux.bin.ub |