Makefile 1.4 KB
Newer Older
1 2 3 4
#
# arch/microblaze/boot/Makefile
#

5 6
MKIMAGE := $(srctree)/scripts/mkuboot.sh

7 8 9
obj-y += linked_dtb.o

targets := linux.bin linux.bin.gz simpleImage.%
10

11
OBJCOPYFLAGS := -O binary
12

13 14 15 16 17 18 19 20 21
# Ensure system.dtb exists
$(obj)/linked_dtb.o: $(obj)/system.dtb

# Generate system.dtb from $(DTB).dtb
ifneq ($(DTB),system)
$(obj)/system.dtb: $(obj)/$(DTB).dtb
	$(call if_changed,cp)
endif

22 23
$(obj)/linux.bin: vmlinux FORCE
	$(call if_changed,objcopy)
24
	$(call if_changed,uimage)
25 26 27 28 29 30
	@echo 'Kernel: $@ is ready' ' (#'`cat .version`')'

$(obj)/linux.bin.gz: $(obj)/linux.bin FORCE
	$(call if_changed,gzip)
	@echo 'Kernel: $@ is ready' ' (#'`cat .version`')'

31 32 33 34
quiet_cmd_cp = CP      $< $@$2
	cmd_cp = cat $< >$@$2 || (rm -f $@ && echo false)

quiet_cmd_strip = STRIP   $@
35
	cmd_strip = $(STRIP) -K microblaze_start -K _end -K __log_buf \
M
Michal Simek 已提交
36
				-K _fdt_start vmlinux -o $@
37

38
quiet_cmd_uimage = UIMAGE  $@.ub
M
Michal Simek 已提交
39 40 41 42
	cmd_uimage = $(CONFIG_SHELL) $(MKIMAGE) -A microblaze -O linux -T kernel \
		-C none -n 'Linux-$(KERNELRELEASE)' \
		-a $(CONFIG_KERNEL_BASE_ADDR) -e $(CONFIG_KERNEL_BASE_ADDR) \
		-d $@ $@.ub
43

44 45
$(obj)/simpleImage.%: vmlinux FORCE
	$(call if_changed,cp,.unstrip)
46 47
	$(call if_changed,objcopy)
	$(call if_changed,uimage)
48 49 50 51 52
	$(call if_changed,strip)
	@echo 'Kernel: $@ is ready' ' (#'`cat .version`')'


# Rule to build device tree blobs
53
DTC_FLAGS := -p 1024
54

55
$(obj)/%.dtb: $(src)/dts/%.dts FORCE
56
	$(call if_changed_dep,dtc)
57

58
clean-files += *.dtb simpleImage.*.unstrip linux.bin.ub