| 1 | # |
| 2 | # Copyright (C) 2010 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.09 |
| 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:=ftp://ftp.denx.de/pub/u-boot |
| 18 | PKG_MD5SUM:= |
| 19 | PKG_TARGETS:=bin |
| 20 | |
| 21 | include $(INCLUDE_DIR)/package.mk |
| 22 | |
| 23 | define uboot/Default |
| 24 | TITLE:= |
| 25 | CONFIG:= |
| 26 | IMAGE:= |
| 27 | endef |
| 28 | |
| 29 | define uboot/sheevaplug |
| 30 | TITLE:=U-boot for the Sheevaplug |
| 31 | endef |
| 32 | |
| 33 | define uboot/dockstar |
| 34 | TITLE:=U-boot for the Seagate Dockstar |
| 35 | endef |
| 36 | |
| 37 | define uboot/iconnect |
| 38 | TITLE:=U-boot for the Iomega iConnect Wireless |
| 39 | endef |
| 40 | |
| 41 | UBOOTS:=sheevaplug dockstar iconnect |
| 42 | |
| 43 | define Package/uboot/template |
| 44 | define Package/uboot-kirkwood-$(1) |
| 45 | SECTION:=boot |
| 46 | CATEGORY:=Boot Loaders |
| 47 | DEPENDS:=@TARGET_kirkwood |
| 48 | TITLE:=$(2) |
| 49 | URL:=http://www.denx.de/wiki/U-Boot |
| 50 | VARIANT:=$(1) |
| 51 | endef |
| 52 | endef |
| 53 | |
| 54 | define BuildUbootPackage |
| 55 | $(eval $(uboot/Default)) |
| 56 | $(eval $(uboot/$(1))) |
| 57 | $(call Package/uboot/template,$(1),$(TITLE)) |
| 58 | endef |
| 59 | |
| 60 | |
| 61 | ifdef BUILD_VARIANT |
| 62 | $(eval $(call uboot/$(BUILD_VARIANT))) |
| 63 | UBOOT_CONFIG:=$(if $(CONFIG),$(CONFIG),$(BUILD_VARIANT)) |
| 64 | UBOOT_IMAGE:=$(if $(IMAGE),$(IMAGE),openwrt-$(BOARD)-$(BUILD_VARIANT)-u-boot.bin) |
| 65 | endif |
| 66 | |
| 67 | define Build/Prepare |
| 68 | $(call Build/Prepare/Default) |
| 69 | $(CP) ./files/* $(PKG_BUILD_DIR) || true |
| 70 | find $(PKG_BUILD_DIR) -name .svn | $(XARGS) rm -rf |
| 71 | endef |
| 72 | |
| 73 | define Build/Configure |
| 74 | $(MAKE) -C $(PKG_BUILD_DIR) \ |
| 75 | $(UBOOT_CONFIG)_config |
| 76 | endef |
| 77 | |
| 78 | define Build/Compile |
| 79 | $(MAKE) -C $(PKG_BUILD_DIR) \ |
| 80 | u-boot.kwb \ |
| 81 | CROSS_COMPILE=$(TARGET_CROSS) |
| 82 | endef |
| 83 | |
| 84 | define Package/uboot/install/default |
| 85 | $(INSTALL_DIR) $(BIN_DIR) |
| 86 | $(CP) $(PKG_BUILD_DIR)/u-boot.bin \ |
| 87 | $(BIN_DIR)/openwrt-$(BOARD)-$(1)-u-boot.bin |
| 88 | $(CP) $(PKG_BUILD_DIR)/u-boot.kwb \ |
| 89 | $(BIN_DIR)/openwrt-$(BOARD)-$(1)-u-boot.kwb |
| 90 | endef |
| 91 | |
| 92 | define Package/uboot/install/template |
| 93 | define Package/uboot-kirkwood-$(1)/install |
| 94 | $(call Package/uboot/install/default,$(2)) |
| 95 | endef |
| 96 | endef |
| 97 | |
| 98 | $(foreach u,$(UBOOTS), \ |
| 99 | $(eval $(call Package/uboot/install/template,$(u),$(u))) \ |
| 100 | ) |
| 101 | |
| 102 | $(foreach u,$(UBOOTS), \ |
| 103 | $(eval $(call BuildUbootPackage,$(u))) \ |
| 104 | $(eval $(call BuildPackage,uboot-kirkwood-$(u))) \ |
| 105 | ) |
| 106 | |