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

5 6 7
obj-y += linked_dtb.o

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

9
OBJCOPYFLAGS := -R .note -R .comment -R .note.gnu.build-id -O binary
10

11 12 13 14 15 16 17 18 19
# 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

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

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

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

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

36 37 38
UIMAGE_IN = $@
UIMAGE_OUT = $@.ub
UIMAGE_LOADADDR = $(CONFIG_KERNEL_BASE_ADDR)
39

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


# Rule to build device tree blobs
49
DTC_FLAGS := -p 1024
50

51
$(obj)/%.dtb: $(src)/dts/%.dts FORCE
52
	$(call if_changed_dep,dtc)
53

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