diff options
| author | Ley Foon Tan <lftan@altera.com> | 2014-11-06 02:20:19 -0500 |
|---|---|---|
| committer | Ley Foon Tan <lftan@altera.com> | 2014-12-07 23:56:06 -0500 |
| commit | 2fc8483fdcde767795402a38a53e647811dc9abf (patch) | |
| tree | 01c734b5191c6ddd5c095fb2a08494720b06f817 /arch/nios2/boot/Makefile | |
| parent | 9cce02ec7146248862ba63a41bf8eb32d9e4fb63 (diff) | |
nios2: Build infrastructure
This patch adds Makefile and Kconfig files required for building a
nios2 kernel.
Signed-off-by: Ley Foon Tan <lftan@altera.com>
Diffstat (limited to 'arch/nios2/boot/Makefile')
| -rw-r--r-- | arch/nios2/boot/Makefile | 52 |
1 files changed, 52 insertions, 0 deletions
diff --git a/arch/nios2/boot/Makefile b/arch/nios2/boot/Makefile new file mode 100644 index 000000000000..59392dc0bdcb --- /dev/null +++ b/arch/nios2/boot/Makefile | |||
| @@ -0,0 +1,52 @@ | |||
| 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 | |||
| 27 | # Rule to build device tree blobs | ||
| 28 | DTB_SRC := $(patsubst "%",%,$(CONFIG_NIOS2_DTB_SOURCE)) | ||
| 29 | |||
| 30 | # Make sure the generated dtb gets removed during clean | ||
| 31 | extra-$(CONFIG_NIOS2_DTB_SOURCE_BOOL) += system.dtb | ||
| 32 | |||
| 33 | $(obj)/system.dtb: $(DTB_SRC) FORCE | ||
| 34 | $(call cmd,dtc) | ||
| 35 | |||
| 36 | # Ensure system.dtb exists | ||
| 37 | $(obj)/linked_dtb.o: $(obj)/system.dtb | ||
| 38 | |||
| 39 | obj-$(CONFIG_NIOS2_DTB_SOURCE_BOOL) += linked_dtb.o | ||
| 40 | |||
| 41 | targets += $(dtb-y) | ||
| 42 | |||
| 43 | # Rule to build device tree blobs with make command | ||
| 44 | $(obj)/%.dtb: $(src)/dts/%.dts FORCE | ||
| 45 | $(call if_changed_dep,dtc) | ||
| 46 | |||
| 47 | $(obj)/dtbs: $(addprefix $(obj)/, $(dtb-y)) | ||
| 48 | |||
| 49 | clean-files := *.dtb | ||
| 50 | |||
| 51 | install: | ||
| 52 | sh $(srctree)/$(src)/install.sh $(KERNELRELEASE) $(BOOTIMAGE) System.map "$(INSTALL_PATH)" | ||
