u-boot: prefer mirror2.openwrt.org over ftp.denx.de - the denx ftp is slow and unreliable
[openwrt/staging/lynxis/omap.git] / package / boot / uboot-omap35xx / Makefile
1 #
2 # Copyright (C) 2011 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 include $(INCLUDE_DIR)/kernel.mk
10
11 PKG_NAME:=u-boot
12 PKG_VERSION:=2010.12
13 PKG_RELEASE:=1
14
15 PKG_BUILD_DIR:=$(KERNEL_BUILD_DIR)/$(PKG_NAME)-$(BUILD_VARIANT)/$(PKG_NAME)-$(PKG_VERSION)
16 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
17 PKG_SOURCE_URL:= \
18 http://mirror2.openwrt.org/sources \
19 ftp://ftp.denx.de/pub/u-boot
20 PKG_MD5SUM:=
21 PKG_TARGETS:=bin
22
23 include $(INCLUDE_DIR)/package.mk
24
25 define uboot/Default
26 TITLE:=
27 CONFIG:=
28 IMAGE:=
29 endef
30
31 define uboot/omap3_overo
32 TITLE:=U-boot for the gumstix board
33 endef
34
35 UBOOTS:=omap3_overo
36
37 define Package/uboot/template
38 define Package/uboot-omap35xx-$(1)
39 SECTION:=boot
40 CATEGORY:=Boot Loaders
41 DEPENDS:=@TARGET_omap35xx
42 TITLE:=$(2)
43 URL:=http://www.denx.de/wiki/U-Boot
44 VARIANT:=$(1)
45 endef
46 endef
47
48 define BuildUbootPackage
49 $(eval $(uboot/Default))
50 $(eval $(uboot/$(1)))
51 $(call Package/uboot/template,$(1),$(TITLE))
52 endef
53
54
55 ifdef BUILD_VARIANT
56 $(eval $(call uboot/$(BUILD_VARIANT)))
57 UBOOT_CONFIG:=$(if $(CONFIG),$(CONFIG),$(BUILD_VARIANT))
58 UBOOT_IMAGE:=$(if $(IMAGE),$(IMAGE),openwrt-$(BOARD)-$(BUILD_VARIANT)-u-boot.bin)
59 endif
60
61 define Build/Prepare
62 $(call Build/Prepare/Default)
63 $(CP) ./files/* $(PKG_BUILD_DIR)
64 find $(PKG_BUILD_DIR) -name .svn | $(XARGS) rm -rf
65 endef
66
67 define Build/Configure
68 $(MAKE) -C $(PKG_BUILD_DIR) \
69 $(UBOOT_CONFIG)_config
70 endef
71
72 define Build/Compile
73 $(MAKE) -C $(PKG_BUILD_DIR) \
74 CROSS_COMPILE=$(TARGET_CROSS)
75 endef
76
77 define Package/uboot/install/template
78 define Package/uboot-omap35xx-$(1)/install
79 $(INSTALL_DIR) $$(1)
80 $(CP) $(PKG_BUILD_DIR)/u-boot.bin $(BIN_DIR)/$(2)
81 endef
82 endef
83
84 $(foreach u,$(UBOOTS), \
85 $(eval $(call Package/uboot/install/template,$(u),openwrt-$(BOARD)-$(u)-u-boot.bin)) \
86 )
87
88 $(foreach u,$(UBOOTS), \
89 $(eval $(call BuildUbootPackage,$(u))) \
90 $(eval $(call BuildPackage,uboot-omap35xx-$(u))) \
91 )