u-boot: prefer mirror2.openwrt.org over ftp.denx.de - the denx ftp is slow and unreliable
[openwrt.git] / package / boot / uboot-kirkwood / Makefile
1 #
2 # Copyright (C) 2010-2012 OpenWrt.org
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_NAME:=u-boot
11 PKG_VERSION:=2012.10
12 PKG_RELEASE:=1
13
14 PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(BUILD_VARIANT)/$(PKG_NAME)-$(PKG_VERSION)
15 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
16 PKG_SOURCE_URL:= \
17         http://mirror2.openwrt.org/sources \
18         ftp://ftp.denx.de/pub/u-boot
19 PKG_MD5SUM:=8655f63b1e5c4647295ac9ce44660be3
20 PKG_TARGETS:=bin
21
22 include $(INCLUDE_DIR)/package.mk
23
24 define uboot/Default
25   TITLE:=
26   CONFIG:=
27   IMAGE:=
28 endef
29
30 define uboot/sheevaplug
31   TITLE:=U-Boot for the SheevaPlug
32 endef
33
34 define uboot/dockstar
35   TITLE:=U-Boot for the Seagate DockStar
36 endef
37
38 define uboot/iconnect
39   TITLE:=U-Boot for the Iomega iConnect Wireless
40 endef
41
42 define uboot/ib62x0
43   TITLE:=U-Boot for the RaidSonic ICY BOX NAS6210 and NAS6220
44 endef
45
46 UBOOTS:=sheevaplug dockstar iconnect ib62x0
47
48 define Package/uboot/template
49 define Package/uboot-kirkwood-$(1)
50   SECTION:=boot
51   CATEGORY:=Boot Loaders
52   DEPENDS:=@TARGET_kirkwood
53   TITLE:=$(2)
54   URL:=http://www.denx.de/wiki/U-Boot
55   VARIANT:=$(1)
56 endef
57 endef
58
59 define BuildUBootPackage
60         $(eval $(uboot/Default))
61         $(eval $(uboot/$(1)))
62         $(call Package/uboot/template,$(1),$(TITLE))
63 endef
64
65 ifdef BUILD_VARIANT
66 $(eval $(call uboot/$(BUILD_VARIANT)))
67 UBOOT_CONFIG:=$(if $(CONFIG),$(CONFIG),$(BUILD_VARIANT))
68 UBOOT_IMAGE:=$(if $(IMAGE),$(IMAGE),openwrt-$(BOARD)-$(BUILD_VARIANT)-u-boot.bin)
69 endif
70
71 define Build/Configure
72         $(MAKE) -C $(PKG_BUILD_DIR) \
73                 $(UBOOT_CONFIG)_config
74 endef
75
76 define Build/Compile
77         $(MAKE) -C $(PKG_BUILD_DIR) \
78                 u-boot.kwb \
79                 CROSS_COMPILE=$(TARGET_CROSS)
80 endef
81
82 define Package/uboot/install/default
83         $(INSTALL_DIR) $(BIN_DIR)/uboot-$(BOARD)-$(1)
84         $(CP) $(PKG_BUILD_DIR)/u-boot.bin \
85                 $(BIN_DIR)/uboot-$(BOARD)-$(1)/openwrt-$(BOARD)-$(1)-u-boot.bin
86         $(CP) $(PKG_BUILD_DIR)/u-boot.kwb \
87                 $(BIN_DIR)/uboot-$(BOARD)-$(1)/openwrt-$(BOARD)-$(1)-u-boot.kwb
88         $(INSTALL_DIR) $(BIN_DIR)/u-boot-kwboot/
89         $(CP) $(PKG_BUILD_DIR)/tools/kwboot \
90                 $(BIN_DIR)/u-boot-kwboot/
91 endef
92
93 define Package/uboot/install/template
94 define Package/uboot-kirkwood-$(1)/install
95         $(call Package/uboot/install/default,$(2))
96 endef
97 endef
98
99 $(foreach u,$(UBOOTS), \
100         $(eval $(call Package/uboot/install/template,$(u),$(u))) \
101 )
102
103 $(foreach u,$(UBOOTS), \
104         $(eval $(call BuildUBootPackage,$(u))) \
105         $(eval $(call BuildPackage,uboot-kirkwood-$(u))) \
106 )