treewide: simplify inclusion of subtarget image files
[openwrt/openwrt.git] / target / linux / at91 / image / Makefile
1 #
2 # Copyright (C) 2006-2013 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 KERNEL_LOADADDR := 0x20008000
11
12 define Build/at91-install-zImage
13 $(CP) $(KDIR)/zImage $@
14 endef
15
16 include $(SUBTARGET).mk
17
18 AT91_SD_BOOT_PARTSIZE:=64
19 FAT32_BLOCK_SIZE:=1024
20 FAT32_BLOCKS:=$(shell echo \
21 $$(($(AT91_SD_BOOT_PARTSIZE)*1024*1024/$(FAT32_BLOCK_SIZE))))
22
23 define Device/Default
24 $(Device/default-nand)
25 PROFILES := Default
26 FILESYSTEMS := squashfs ubifs ext4
27 DEVICE_DTS := $(1)
28 KERNEL_NAME := zImage
29 KERNEL_SIZE := 4096k
30 KERNEL := kernel-bin | append-dtb | lzma | uImage lzma
31 DTB_SIZE := 128k
32 endef
33
34 define Device/dtb
35 KERNEL := kernel-bin | lzma | uImage lzma
36 endef
37
38 define Device/evaluation-sdimage
39 IMAGES += sdcard.img.gz
40 IMAGE/sdcard.img.gz := at91-sdcard
41 endef
42
43 define Device/evaluation
44 KERNEL_INSTALL := 1
45 KERNEL_SUFFIX := -uImage
46 IMAGES := root.ubi
47 IMAGE/root.ubi := append-ubi
48 endef
49
50 define Device/evaluation-zImage
51 IMAGES += zImage
52 IMAGE/zImage := at91-install-zImage
53 endef
54
55 define Device/evaluation-dtb
56 $(Device/evaluation)
57 $(Device/dtb)
58 $(Device/evaluation-zImage)
59 IMAGES += dtb
60 IMAGE/dtb := install-dtb
61 KERNEL_SUFFIX := -fit-zImage.itb
62 KERNEL := kernel-bin | gzip | fit gzip $$(DTS_DIR)/$$(DEVICE_DTS).dtb
63 endef
64
65 define Device/evaluation-fit
66 $(Device/evaluation)
67 KERNEL_SUFFIX := -fit-uImage.itb
68 KERNEL := kernel-bin | lzma | fit lzma $$(DTS_DIR)/$$(DEVICE_DTS).dtb
69 endef
70
71 define Device/production
72 UBINIZE_OPTS := -E 5
73 IMAGES := factory.bin
74 IMAGE/factory.bin := append-kernel | pad-to $$$$(KERNEL_SIZE) | append-ubi
75 endef
76
77 define Device/production-dtb
78 $(Device/production)
79 $(Device/dtb)
80 IMAGE/factory.bin := append-dtb | pad-to $$$$(DTB_SIZE) \
81 | append-kernel | pad-to $$$$(KERNEL_SIZE) | append-ubi
82 endef
83
84 $(eval $(call BuildImage))