uboot-at91: multiple build fixes
[oweals/openwrt.git] / package / boot / uboot-at91 / Makefile
1 #
2 # Copyright (C) 2016 Ben Whitten <ben.whitten@gmail.com>
3 #
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
6 #
7
8 include $(TOPDIR)/rules.mk
9
10 PKG_VERSION:=2016.05
11 PKG_RELEASE:=1
12
13 PKG_HASH:=87d02275615aaf0cd007b54cbe9fbadceef2bee7c79e6c323ea1ae8956dcb171
14
15 include $(INCLUDE_DIR)/u-boot.mk
16 include $(INCLUDE_DIR)/package.mk
17
18 define U-Boot/Default
19   BUILD_TARGET:=at91
20   UBOOT_IMAGE:=u-boot.bin boot.bin
21 endef
22
23 define U-Boot/at91sam9m10g45ek_nandflash
24   NAME:=AT91SAM9M10G45-EK board (NandFlash)
25   BUILD_SUBTARGET:=legacy
26   BUILD_DEVICES:=at91sam9m10g45ek
27 endef
28
29 define U-Boot/at91sam9x5ek_nandflash
30   NAME:=AT91SAM9X5-EK board (NandFlash)
31   BUILD_SUBTARGET:=legacy
32   BUILD_DEVICES:=at91sam9g15ek at91sam9g25ek at91sam9g35ek at91sam9x25ek at91sam9x35ek
33 endef
34
35 define U-Boot/sama5d3_xplained_nandflash
36   NAME:=SAMA5D3 Xplained board (NandFlash)
37   BUILD_SUBTARGET:=sama5
38   BUILD_DEVICES:=at91-sama5d3_xplained
39 endef
40
41 define U-Boot/sama5d3_xplained_mmc
42   NAME:=SAMA5D3 Xplained board (SDcard)
43   BUILD_SUBTARGET:=sama5
44   BUILD_DEVICES:=at91-sama5d3_xplained
45 endef
46
47 define U-Boot/sama5d2_xplained_spiflash
48   NAME:=SAMA5D2 Xplained board (SPI Flash)
49   BUILD_SUBTARGET:=sama5
50   BUILD_DEVICES:=at91-sama5d2_xplained
51 endef
52
53 define U-Boot/sama5d2_xplained_mmc
54   NAME:=SAMA5D2 Xplained board (SDcard/EMMC)
55   BUILD_SUBTARGET:=sama5
56   BUILD_DEVICES:=at91-sama5d2_xplained
57 endef
58
59 define U-Boot/sama5d4_xplained_spiflash
60   NAME:=SAMA5D4 Xplained board (SPI Flash)
61   BUILD_SUBTARGET:=sama5
62   BUILD_DEVICES:=at91-sama5d4_xplained
63 endef
64
65 define U-Boot/sama5d4_xplained_mmc
66   NAME:=SAMA5D4 Xplained board (SDcard)
67   BUILD_SUBTARGET:=sama5
68   BUILD_DEVICES:=at91-sama5d4_xplained
69 endef
70
71 define U-Boot/sama5d4_xplained_nandflash
72   NAME:=SAMA5D4 Xplained board (NandFlash)
73   BUILD_SUBTARGET:=sama5
74   BUILD_DEVICES:=at91-sama5d4_xplained
75 endef
76
77 UBOOT_TARGETS := \
78         at91sam9m10g45ek_nandflash \
79         at91sam9x5ek_nandflash \
80         sama5d3_xplained_nandflash \
81         sama5d3_xplained_mmc \
82         sama5d2_xplained_mmc \
83         sama5d2_xplained_spiflash \
84         sama5d4_xplained_mmc \
85         sama5d4_xplained_spiflash \
86         sama5d4_xplained_nandflash
87
88 define Build/Compile
89         +$(MAKE) $(PKG_JOBS) -C $(PKG_BUILD_DIR) \
90                 CROSS_COMPILE=$(TARGET_CROSS) \
91                 KCFLAGS="$(filter-out -fstack-protector, $(TARGET_CFLAGS))"
92 endef
93
94 $(eval $(call BuildPackage/U-Boot))