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 | # Where the DTS files live |
| 14 | dtstree := $(srctree)/$(src)/dts |
| 15 | |
| 16 | # Ensure system.dtb exists |
| 17 | $(obj)/linked_dtb.o: $(obj)/system.dtb |
| 18 | |
| 19 | # Generate system.dtb from $(DTB).dtb |
| 20 | ifneq ($(DTB),system) |
| 21 | $(obj)/system.dtb: $(obj)/$(DTB).dtb |
| 22 | $(call if_changed,cp) |
| 23 | endif |
| 24 | |
Michal Simek | 5f8ffb5 | 2009-03-27 14:25:51 +0100 | [diff] [blame] | 25 | $(obj)/linux.bin: vmlinux FORCE |
Michal Simek | 5f8ffb5 | 2009-03-27 14:25:51 +0100 | [diff] [blame] | 26 | $(call if_changed,objcopy) |
Michal Simek | 6a8dfe1 | 2009-10-14 17:38:26 +0200 | [diff] [blame] | 27 | $(call if_changed,uimage) |
Michal Simek | 5f8ffb5 | 2009-03-27 14:25:51 +0100 | [diff] [blame] | 28 | @echo 'Kernel: $@ is ready' ' (#'`cat .version`')' |
| 29 | |
| 30 | $(obj)/linux.bin.gz: $(obj)/linux.bin FORCE |
| 31 | $(call if_changed,gzip) |
| 32 | @echo 'Kernel: $@ is ready' ' (#'`cat .version`')' |
| 33 | |
Michal Simek | f05131c | 2009-09-14 15:15:49 +0200 | [diff] [blame] | 34 | quiet_cmd_cp = CP $< $@$2 |
| 35 | cmd_cp = cat $< >$@$2 || (rm -f $@ && echo false) |
| 36 | |
| 37 | quiet_cmd_strip = STRIP $@ |
Michal Simek | ca28b51 | 2010-07-28 09:29:11 +0200 | [diff] [blame] | 38 | cmd_strip = $(STRIP) -K microblaze_start -K _end -K __log_buf \ |
Michal Simek | 61b403a | 2010-07-28 07:58:06 +0200 | [diff] [blame] | 39 | -K _fdt_start vmlinux -o $@ |
Michal Simek | f05131c | 2009-09-14 15:15:49 +0200 | [diff] [blame] | 40 | |
Michal Simek | 6a8dfe1 | 2009-10-14 17:38:26 +0200 | [diff] [blame] | 41 | quiet_cmd_uimage = UIMAGE $@.ub |
Michal Simek | 61b403a | 2010-07-28 07:58:06 +0200 | [diff] [blame] | 42 | cmd_uimage = $(CONFIG_SHELL) $(MKIMAGE) -A microblaze -O linux -T kernel \ |
| 43 | -C none -n 'Linux-$(KERNELRELEASE)' \ |
| 44 | -a $(CONFIG_KERNEL_BASE_ADDR) -e $(CONFIG_KERNEL_BASE_ADDR) \ |
| 45 | -d $@ $@.ub |
Michal Simek | 6a8dfe1 | 2009-10-14 17:38:26 +0200 | [diff] [blame] | 46 | |
Michal Simek | f05131c | 2009-09-14 15:15:49 +0200 | [diff] [blame] | 47 | $(obj)/simpleImage.%: vmlinux FORCE |
| 48 | $(call if_changed,cp,.unstrip) |
Michal Simek | 6a8dfe1 | 2009-10-14 17:38:26 +0200 | [diff] [blame] | 49 | $(call if_changed,objcopy) |
| 50 | $(call if_changed,uimage) |
Michal Simek | f05131c | 2009-09-14 15:15:49 +0200 | [diff] [blame] | 51 | $(call if_changed,strip) |
| 52 | @echo 'Kernel: $@ is ready' ' (#'`cat .version`')' |
| 53 | |
| 54 | # Rule to build device tree blobs |
| 55 | DTC = $(objtree)/scripts/dtc/dtc |
| 56 | |
| 57 | # Rule to build device tree blobs |
| 58 | quiet_cmd_dtc = DTC $@ |
| 59 | cmd_dtc = $(DTC) -O dtb -o $(obj)/$*.dtb -b 0 -p 1024 $(dtstree)/$*.dts |
| 60 | |
| 61 | $(obj)/%.dtb: $(dtstree)/%.dts FORCE |
| 62 | $(call if_changed,dtc) |
| 63 | |
Arun Bhanu | 8a8804f | 2010-03-17 16:06:03 +0800 | [diff] [blame] | 64 | clean-files += *.dtb simpleImage.*.unstrip linux.bin.ub |