Ley Foon Tan | 2fc8483 | 2014-11-06 15:20:19 +0800 | [diff] [blame] | 1 | # |
| 2 | # arch/nios2/boot/Makefile |
| 3 | # |
| 4 | # This file is subject to the terms and conditions of the GNU General Public |
| 5 | # License. See the file "COPYING" in the main directory of this archive |
| 6 | # for more details. |
| 7 | # |
| 8 | |
| 9 | UIMAGE_LOADADDR = $(shell $(NM) vmlinux | awk '$$NF == "_stext" {print $$1}') |
| 10 | UIMAGE_ENTRYADDR = $(shell $(NM) vmlinux | awk '$$NF == "_start" {print $$1}') |
| 11 | UIMAGE_COMPRESSION = gzip |
| 12 | |
| 13 | OBJCOPYFLAGS_vmlinux.bin := -O binary |
| 14 | |
| 15 | targets += vmlinux.bin vmlinux.gz vmImage |
| 16 | |
| 17 | $(obj)/vmlinux.bin: vmlinux FORCE |
| 18 | $(call if_changed,objcopy) |
| 19 | |
| 20 | $(obj)/vmlinux.gz: $(obj)/vmlinux.bin FORCE |
| 21 | $(call if_changed,gzip) |
| 22 | |
| 23 | $(obj)/vmImage: $(obj)/vmlinux.gz |
| 24 | $(call if_changed,uimage) |
| 25 | @$(kecho) 'Kernel: $@ is ready' |
| 26 | |
Ley Foon Tan | 0162362 | 2015-02-10 23:26:34 +0800 | [diff] [blame] | 27 | $(obj)/zImage: $(obj)/compressed/vmlinux FORCE |
| 28 | $(call if_changed,objcopy) |
| 29 | @$(kecho) 'Kernel: $@ is ready' |
| 30 | |
| 31 | $(obj)/compressed/vmlinux: $(obj)/vmlinux.gz FORCE |
| 32 | $(Q)$(MAKE) $(build)=$(obj)/compressed $@ |
| 33 | |
Ley Foon Tan | 2fc8483 | 2014-11-06 15:20:19 +0800 | [diff] [blame] | 34 | # Rule to build device tree blobs |
| 35 | DTB_SRC := $(patsubst "%",%,$(CONFIG_NIOS2_DTB_SOURCE)) |
| 36 | |
| 37 | # Make sure the generated dtb gets removed during clean |
| 38 | extra-$(CONFIG_NIOS2_DTB_SOURCE_BOOL) += system.dtb |
| 39 | |
| 40 | $(obj)/system.dtb: $(DTB_SRC) FORCE |
| 41 | $(call cmd,dtc) |
| 42 | |
| 43 | # Ensure system.dtb exists |
| 44 | $(obj)/linked_dtb.o: $(obj)/system.dtb |
| 45 | |
| 46 | obj-$(CONFIG_NIOS2_DTB_SOURCE_BOOL) += linked_dtb.o |
| 47 | |
| 48 | targets += $(dtb-y) |
| 49 | |
| 50 | # Rule to build device tree blobs with make command |
| 51 | $(obj)/%.dtb: $(src)/dts/%.dts FORCE |
| 52 | $(call if_changed_dep,dtc) |
| 53 | |
| 54 | $(obj)/dtbs: $(addprefix $(obj)/, $(dtb-y)) |
| 55 | |
| 56 | clean-files := *.dtb |
| 57 | |
| 58 | install: |
| 59 | sh $(srctree)/$(src)/install.sh $(KERNELRELEASE) $(BOOTIMAGE) System.map "$(INSTALL_PATH)" |