odhcp6c: various fixes
[openwrt/staging/chunkeey.git] / package / boot / uboot-imx23 / Makefile
1 #
2 # Copyright (C) 2013 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:=2013.07
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:=ftp://ftp.denx.de/pub/u-boot
17 PKG_MD5SUM:=8445162690052e6afd4b8f87af2bb557
18
19 include $(INCLUDE_DIR)/package.mk
20
21 define uboot/Default
22 TITLE:=
23 CONFIG:=
24 IMAGE:=
25 endef
26
27 define uboot/mx23_olinuxino
28 TITLE:=U-Boot 2013.07 for the Olinuxino i.MX233
29 endef
30
31 UBOOTS := \
32 mx23_olinuxino
33
34 define Package/uboot/template
35 define Package/uboot-imx23-$(1)
36 SECTION:=boot
37 CATEGORY:=Boot Loaders
38 DEPENDS:=@TARGET_imx23
39 TITLE:=$(2)
40 URL:=http://www.denx.de/wiki/U-Boot
41 VARIANT:=$(1)
42 MAINTAINER:=Zoltan HERPAI <wigyori@uid0.hu>
43 endef
44 endef
45
46 define BuildUBootPackage
47 $(eval $(uboot/Default))
48 $(eval $(uboot/$(1)))
49 $(call Package/uboot/template,$(1),$(TITLE))
50 endef
51
52 ifdef BUILD_VARIANT
53 $(eval $(call uboot/$(BUILD_VARIANT)))
54 UBOOT_CONFIG:=$(if $(CONFIG),$(CONFIG),$(BUILD_VARIANT))
55 UBOOT_IMAGE:=$(if $(IMAGE),$(IMAGE),openwrt-$(BOARD)-$(BUILD_VARIANT)-u-boot.bin)
56 endif
57
58 define Build/Configure
59 $(MAKE) -C $(PKG_BUILD_DIR) \
60 $(UBOOT_CONFIG)_config
61 endef
62
63 define Build/Compile
64 $(MAKE) -C $(PKG_BUILD_DIR) \
65 CROSS_COMPILE=$(TARGET_CROSS) u-boot.sb
66 endef
67
68
69 define Package/uboot/install/default
70 $(INSTALL_DIR) $(BIN_DIR)/uboot-$(BOARD)-$(1)
71 dd if=$(PKG_BUILD_DIR)/u-boot.sb of=$(BIN_DIR)/uboot-$(BOARD)-$(1).sb bs=512 seek=4
72 endef
73
74 define Package/uboot/install/template
75 define Package/uboot-imx23-$(1)/install
76 $(call Package/uboot/install/default,$(2))
77 endef
78 endef
79
80 $(foreach u,$(UBOOTS), \
81 $(eval $(call Package/uboot/install/template,$(u),$(u))) \
82 )
83
84 $(foreach u,$(UBOOTS), \
85 $(eval $(call BuildUBootPackage,$(u))) \
86 $(eval $(call BuildPackage,uboot-imx23-$(u))) \
87 )