treewide: clean up and unify PKG_VERSION for git based downloads
[openwrt/staging/blogic.git] / package / boot / uboot-layerscape / 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
12 PKG_VERSION:=v1.0
13 PKG_RELEASE:=1
14
15 PKG_SOURCE_PROTO:=git
16 PKG_MIRROR_HASH:=6aba7cb32d655dacb49bd188706bf1284159ae9b1fa69056df634b90070c3768
17 PKG_SOURCE_URL:=https://github.com/fsl-jyt/u-boot.git
18 PKG_SOURCE_VERSION:=aefcbf4c2bb36e1f0ead61181e5fe1119b5683ad
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 IMAGE:=
31 endef
32
33 define uboot/ls1043ardb
34 TITLE:=U-Boot $(PKG_NAME)-$(PKG_VERSION) for NXP ls1043ardb 64b Dev Board
35 CONFIG=ls1043ardb
36 endef
37
38 define uboot/ls1046ardb
39 TITLE:=U-Boot $(PKG_NAME)-$(PKG_VERSION) for NXP ls1046ardb 64b Dev Board
40 CONFIG=ls1046ardb_qspi
41 endef
42
43 define uboot/ls1012ardb
44 TITLE:=U-Boot $(PKG_NAME)-$(PKG_VERSION) for NXP ls1012ardb 64b Dev Board
45 CONFIG=ls1012ardb_qspi
46 IMAGE=u-boot-swap.bin
47 endef
48
49 UBOOTS := \
50 ls1043ardb \
51 ls1046ardb \
52 ls1012ardb
53
54 define Package/uboot/template
55 define Package/uboot-layerscape-64b-$(1)
56 SECTION:=boot
57 CATEGORY:=Boot Loaders
58 DEPENDS:= @TARGET_layerscape_64b
59 TITLE:=$(2)
60 URL:=http://git.freescale.com/git/cgit.cgi/ppc/sdk/u-boot.git/snapshot
61 VARIANT:=$(1)
62 MAINTAINER:=Jiang Yutang <jiangyutang1978@gmail.com>
63 endef
64 endef
65
66 define BuildUBootPackage
67 $(eval $(uboot/Default))
68 $(eval $(uboot/$(1)))
69 $(call Package/uboot/template,$(1),$(TITLE))
70 endef
71
72 ifdef BUILD_VARIANT
73 $(eval $(call uboot/$(BUILD_VARIANT)))
74 UBOOT_CONFIG:=$(if $(CONFIG),$(CONFIG),$(BUILD_VARIANT))
75 UBOOT_IMAGE:=$(if $(IMAGE),$(IMAGE),u-boot-dtb.bin)
76 endif
77
78 define Build/Configure
79 +$(MAKE) $(PKG_JOBS) -C $(PKG_BUILD_DIR) \
80 $(UBOOT_CONFIG)_config
81 endef
82
83 define Build/Compile
84 +$(MAKE) $(PKG_JOBS) -C $(PKG_BUILD_DIR) \
85 CROSS_COMPILE=$(TARGET_CROSS) DTC=$(LINUX_DIR)/scripts/dtc/dtc
86 endef
87
88 define Package/uboot/install/default
89 $(CP) $(PKG_BUILD_DIR)/$(UBOOT_IMAGE) $(KDIR)/$(1)-64b-uboot.bin
90 endef
91
92 define Package/uboot/install/template
93 define Package/uboot-layerscape-64b-$(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-layerscape-64b-$(u))) \
105 )