targets: add kernel image dependencies on device tree files
[openwrt.git] / target / linux / arc770 / image / Makefile
1 #
2 # Copyright (C) 2015 OpenWrt.org
3 #
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
6 #
7 include $(TOPDIR)/rules.mk
8 include $(INCLUDE_DIR)/image.mk
9
10 define Build/patch-dtb
11         $(call Image/BuildDTB,../dts/$(DEVICE_DTS).dts,$@.dtb)
12         $(STAGING_DIR_HOST)/bin/patch-dtb $@ $@.dtb
13 endef
14
15 # Shared device definition: applies to every defined device
16 define Device/Default
17   PROFILES = Default $$(DEVICE_PROFILE)
18   KERNEL_DEPENDS = $$(wildcard ../dts/$$(DEVICE_DTS).dts)
19   KERNEL_SUFFIX := .elf
20   KERNEL_INITRAMFS := kernel-bin | patch-dtb
21   KERNEL_INITRAMFS_NAME = $$(KERNEL_NAME)-initramfs.elf
22   DEVICE_PROFILE :=
23   DEVICE_DTS :=
24 endef
25 DEVICE_VARS += DEVICE_PROFILE DEVICE_DTS
26
27 define add_arc770
28   define Device/$(1)
29     DEVICE_PROFILE := $(1)
30     DEVICE_DTS := $(1)
31   endef
32   TARGET_DEVICES += $(1)
33 endef
34
35 # DesignWare AXS101
36 $(eval $(call add_arc770,axs101))
37
38 # nSIM with ARC770
39 $(eval $(call add_arc770,nsim_700))
40
41 $(eval $(call BuildImage))