treewide: clean up and unify PKG_VERSION for git based downloads
[openwrt/staging/yousong.git] / package / boot / uboot-layerscape-32b / Makefile
1 #
2 # Copyright (C) 2016 Jiang Yutang <jiangyutang1978@gmail.com>
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)/image.mk
10
11 PKG_NAME:=uboot-layerscape-32bit
12 PKG_VERSION:=v1.0
13 PKG_RELEASE:=1
14
15 PKG_SOURCE_PROTO:=git
16 PKG_MIRROR_HASH:=b62f4a55882ffb6b57da24ad9eaa98237141941d273e06a2244220a3e6b82ce7
17 PKG_SOURCE_URL:=https://github.com/fsl-jyt/uboot-ls-32b.git
18 PKG_SOURCE_VERSION:=763de09cc7265e3147e2df2e15f91c73231907f4
19
20 PKG_BUILD_DIR=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)-$(BUILD_VARIANT)/$(PKG_NAME)-$(PKG_VERSION)
21
22 PKG_LICENSE:=GPL-2.0 GPL-2.0+
23 PKG_LICENSE_FILES:=Licenses/README
24
25 include $(INCLUDE_DIR)/package.mk
26
27 define uboot/Default
28 TITLE:=
29 CONFIG:=
30 endef
31
32 define uboot/ls1043ardb
33 TITLE:=U-Boot binary $(PKG_NAME)-$(PKG_VERSION) for NXP ls1043ardb 32b Dev Board
34 CONFIG=ls1043ardb-uboot.bin
35 endef
36
37 define uboot/ls1046ardb
38 TITLE:=U-Boot binary $(PKG_NAME)-$(PKG_VERSION) for NXP ls1046ardb 32b Dev Board
39 CONFIG=ls1046ardb-uboot.bin
40 endef
41
42 define uboot/ls1012ardb
43 TITLE:=U-Boot binary $(PKG_NAME)-$(PKG_VERSION) for NXP ls1012ardb 32b Dev Board
44 CONFIG=ls1012ardb-uboot.bin.swap
45 endef
46
47 UBOOTS := \
48 ls1043ardb \
49 ls1046ardb \
50 ls1012ardb
51
52 define Package/uboot/template
53 define Package/uboot-layerscape-32b-$(1)
54 SECTION:=boot
55 CATEGORY:=Boot Loaders
56 DEPENDS:= @TARGET_layerscape_32b
57 TITLE:=$(2)
58 URL:=https://github.com/fsl-jyt/uboot-ls-32b.git
59 VARIANT:=$(1)
60 MAINTAINER:=Jiang Yutang <jiangyutang1978@gmail.com>
61 endef
62 endef
63
64 define BuildUBootPackage
65 $(eval $(uboot/Default))
66 $(eval $(uboot/$(1)))
67 $(call Package/uboot/template,$(1),$(TITLE))
68 endef
69
70 ifdef BUILD_VARIANT
71 $(eval $(call uboot/$(BUILD_VARIANT)))
72 UBOOT_CONFIG:=$(if $(CONFIG),$(CONFIG),$(BUILD_VARIANT))
73 endif
74
75 define Build/Configure
76 endef
77
78 define Build/Compile
79 endef
80
81 define Package/uboot/install/default
82 $(CP) $(PKG_BUILD_DIR)/$(UBOOT_CONFIG) $(KDIR)/$(1)-32b-uboot.bin
83 endef
84
85 define Package/uboot/install/template
86 define Package/uboot-layerscape-32b-$(1)/install
87 $(call Package/uboot/install/default,$(2))
88 endef
89 endef
90
91 $(foreach u,$(UBOOTS), \
92 $(eval $(call Package/uboot/install/template,$(u),$(u))) \
93 )
94
95 $(foreach u,$(UBOOTS), \
96 $(eval $(call BuildUBootPackage,$(u))) \
97 $(eval $(call BuildPackage,uboot-layerscape-32b-$(u))) \
98 )