treewide: clean up and unify PKG_VERSION for git based downloads
[openwrt/staging/blogic.git] / package / boot / uboot-pxa / Makefile
1 #
2 # Copyright (C) 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 include $(INCLUDE_DIR)/kernel.mk
10
11 PKG_NAME:=u-boot
12 PKG_RELEASE:=1
13
14 PKG_SOURCE_PROTO:=git
15 PKG_SOURCE_URL:=https://github.com/ashcharles/verdex-uboot.git
16 PKG_SOURCE_DATE:=2011-08-25
17 PKG_SOURCE_VERSION:=ca6bf3ef6ac5f5132a359b43dfa31e07076b74b7
18 PKG_MIRROR_HASH:=7c92525b6c7bc0b6f065a9bfdf64d58a61583709cb44acb62a157ad3efc7c491
19
20 PKG_LICENSE:=GPL-2.0 GPL-2.0+
21 PKG_LICENSE_FILES:=Licenses/README
22
23 include $(INCLUDE_DIR)/package.mk
24
25 define uboot/Default
26 TITLE:=
27 CONFIG:=
28 IMAGE:=
29 endef
30
31 define uboot/gumstix
32 TITLE:=U-Boot for the Gumstix Verdex
33 endef
34
35 UBOOTS:=gumstix
36
37 define Package/uboot/template
38 define Package/uboot-pxa-$(1)
39 SECTION:=boot
40 CATEGORY:=Boot Loaders
41 DEPENDS:=@TARGET_pxa
42 TITLE:=$(2)
43 URL:=http://www.denx.de/wiki/U-Boot
44 VARIANT:=$(1)
45 MAINTAINER:=Florian Fainelli <florian@openwrt.org>
46 endef
47 endef
48
49 define BuildUBootPackage
50 $(eval $(uboot/Default))
51 $(eval $(uboot/$(1)))
52 $(call Package/uboot/template,$(1),$(TITLE))
53 endef
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/Configure
62 $(MAKE) -C $(PKG_BUILD_DIR) \
63 $(UBOOT_CONFIG)_config
64 endef
65
66 define Build/Compile
67 $(MAKE) -C $(PKG_BUILD_DIR) \
68 u-boot.bin \
69 CROSS_COMPILE=$(TARGET_CROSS)
70 endef
71
72 define Package/uboot/install/default
73 $(INSTALL_DIR) $(BIN_DIR)
74 $(CP) $(PKG_BUILD_DIR)/u-boot.bin \
75 $(BIN_DIR)/openwrt-$(BOARD)-$(1)-u-boot.bin
76 endef
77
78 define Package/uboot/install/template
79 define Package/uboot-pxa-$(1)/install
80 $(call Package/uboot/install/default,$(2))
81 endef
82 endef
83
84 $(foreach u,$(UBOOTS), \
85 $(eval $(call Package/uboot/install/template,$(u),$(u))) \
86 )
87
88 $(foreach u,$(UBOOTS), \
89 $(eval $(call BuildUBootPackage,$(u))) \
90 $(eval $(call BuildPackage,uboot-pxa-$(u))) \
91 )