f158796fa969d32c0f72b33d2cdda4bc67ad3a7d
[openwrt/staging/blogic.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_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
17 PKG_MIRROR_HASH:=c40a891a41741b499ad19ce154dc3c8ea63c49bff34a23230780bd210bd7f399
18 PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
19 PKG_SOURCE_URL:=https://github.com/fsl-jyt/uboot-ls-32b.git
20 PKG_SOURCE_VERSION:=763de09cc7265e3147e2df2e15f91c73231907f4
21
22 PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)-$(BUILD_VARIANT)/$(PKG_NAME)-$(PKG_VERSION)
23
24 PKG_LICENSE:=GPL-2.0 GPL-2.0+
25 PKG_LICENSE_FILES:=Licenses/README
26
27 include $(INCLUDE_DIR)/package.mk
28
29 define uboot/Default
30 TITLE:=
31 CONFIG:=
32 endef
33
34 define uboot/ls1043ardb
35 TITLE:=U-Boot binary $(PKG_NAME)-$(PKG_VERSION) for NXP ls1043ardb 32b Dev Board
36 CONFIG=ls1043ardb-uboot.bin
37 endef
38
39 define uboot/ls1046ardb
40 TITLE:=U-Boot binary $(PKG_NAME)-$(PKG_VERSION) for NXP ls1046ardb 32b Dev Board
41 CONFIG=ls1046ardb-uboot.bin
42 endef
43
44 define uboot/ls1012ardb
45 TITLE:=U-Boot binary $(PKG_NAME)-$(PKG_VERSION) for NXP ls1012ardb 32b Dev Board
46 CONFIG=ls1012ardb-uboot.bin.swap
47 endef
48
49 UBOOTS := \
50 ls1043ardb \
51 ls1046ardb \
52 ls1012ardb
53
54 define Package/uboot/template
55 define Package/uboot-layerscape-32b-$(1)
56 SECTION:=boot
57 CATEGORY:=Boot Loaders
58 DEPENDS:= @TARGET_layerscape_32b
59 TITLE:=$(2)
60 URL:=https://github.com/fsl-jyt/uboot-ls-32b.git
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 endif
76
77 define Build/Configure
78 endef
79
80 define Build/Compile
81 endef
82
83 define Package/uboot/install/default
84 $(CP) $(PKG_BUILD_DIR)/$(UBOOT_CONFIG) $(KDIR)/$(1)-32b-uboot.bin
85 endef
86
87 define Package/uboot/install/template
88 define Package/uboot-layerscape-32b-$(1)/install
89 $(call Package/uboot/install/default,$(2))
90 endef
91 endef
92
93 $(foreach u,$(UBOOTS), \
94 $(eval $(call Package/uboot/install/template,$(u),$(u))) \
95 )
96
97 $(foreach u,$(UBOOTS), \
98 $(eval $(call BuildUBootPackage,$(u))) \
99 $(eval $(call BuildPackage,uboot-layerscape-32b-$(u))) \
100 )