at91: fix legacy build
[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 ifeq ($(SUBTARGET),legacy)
13 include ./legacy.mk
14 endif
15 ifeq ($(SUBTARGET),sama5)
16 include ./sama5.mk
17 endif
18
19 define Device/Default
20 $(Device/default-nand)
21 PROFILES := Default
22 FILESYSTEMS := squashfs ubifs
23 DEVICE_DTS := $(1)
24 KERNEL_NAME := zImage
25 KERNEL_SIZE := 4096k
26 KERNEL := kernel-bin | append-dtb | lzma | uImage lzma
27 DTB_SIZE := 128k
28 endef
29
30 define Device/dtb
31 KERNEL := kernel-bin | lzma | uImage lzma
32 endef
33
34 define Device/evaluation
35 KERNEL_INSTALL := 1
36 KERNEL_SUFFIX := -uImage
37 IMAGES := root.ubi
38 IMAGE/root.ubi := append-ubi
39 endef
40
41 define Device/evaluation-zImage
42 IMAGES += zImage
43 IMAGE/zImage := install-zImage
44 endef
45
46 define Device/evaluation-dtb
47 $(Device/evaluation)
48 $(Device/dtb)
49 $(Device/evaluation-zImage)
50 IMAGES += dtb
51 IMAGE/dtb := install-dtb
52 endef
53
54 define Device/evaluation-fit
55 $(Device/evaluation)
56 KERNEL_SUFFIX := -fit-uImage.itb
57 KERNEL := kernel-bin | lzma | fit lzma $$(DTS_DIR)/$$(DEVICE_DTS).dtb
58 endef
59
60 define Device/production
61 UBINIZE_OPTS := -E 5
62 IMAGES := factory.bin
63 IMAGE/factory.bin := append-kernel | pad-to $$$$(KERNEL_SIZE) | append-ubi
64 endef
65
66 define Device/production-dtb
67 $(Device/production)
68 $(Device/dtb)
69 IMAGE/factory.bin := append-dtb | pad-to $$$$(DTB_SIZE) \
70 | append-kernel | pad-to $$$$(KERNEL_SIZE) | append-ubi
71 endef
72
73 $(eval $(call BuildImage))