2 # Copyright (C) 2010 OpenWrt.org
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
8 include $(TOPDIR)/rules.mk
9 include $(INCLUDE_DIR)/kernel.mk
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:=ftp://ftp.denx.de/pub/u-boot
21 include $(INCLUDE_DIR)/package.mk
29 define uboot/sheevaplug
30 TITLE:=U-boot for the Sheevaplug
34 TITLE:=U-boot for the Seagate Dockstar
37 UBOOTS:=sheevaplug dockstar
39 define Package/uboot/template
40 define Package/uboot-kirkwood-$(1)
42 CATEGORY:=Boot Loaders
43 DEPENDS:=@TARGET_kirkwood
45 URL:=http://www.denx.de/wiki/U-Boot
50 define BuildUbootPackage
51 $(eval $(uboot/Default))
53 $(call Package/uboot/template,$(1),$(TITLE))
58 $(eval $(call uboot/$(BUILD_VARIANT)))
59 UBOOT_CONFIG:=$(if $(CONFIG),$(CONFIG),$(BUILD_VARIANT))
60 UBOOT_IMAGE:=$(if $(IMAGE),$(IMAGE),openwrt-$(BOARD)-$(BUILD_BARIANT)-u-boot.bin)
64 $(call Build/Prepare/Default)
65 $(CP) ./files/* $(PKG_BUILD_DIR) || true
66 find $(PKG_BUILD_DIR) -name .svn | $(XARGS) rm -rf
69 define Build/Configure
70 $(MAKE) -C $(PKG_BUILD_DIR) \
71 $(UBOOT_CONFIG)_config
75 $(MAKE) -C $(PKG_BUILD_DIR) \
76 CROSS_COMPILE=$(TARGET_CROSS)
79 define Package/uboot/install/default
80 $(INSTALL_DIR) $(BIN_DIR)
81 $(CP) $(PKG_BUILD_DIR)/u-boot.bin \
82 $(BIN_DIR)/openwrt-$(BOARD)-$(1)-u-boot.bin
85 define Package/uboot/install/template
86 define Package/uboot-kirkwood-$(1)/install
87 $(call Package/uboot/install/default,$(2))
91 $(foreach u,$(UBOOTS), \
92 $(eval $(call Package/uboot/install/template,$(u),$(u))) \
95 $(foreach u,$(UBOOTS), \
96 $(eval $(call BuildUbootPackage,$(u))) \
97 $(eval $(call BuildPackage,uboot-kirkwood-$(u))) \