d6a6d2654a858d372d7ee29253308590f020567c
[openwrt/staging/wigyori.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_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
18 PKG_SOURCE_URL:=https://github.com/fsl-jyt/uboot-ls-32b.git
19 PKG_SOURCE_VERSION:=4fbf7e76eb7671d9822d0310319f6ad70d324547
20
21 PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)-$(BUILD_VARIANT)/$(PKG_NAME)-$(PKG_VERSION)
22
23 PKG_LICENSE:=GPL-2.0 GPL-2.0+
24 PKG_LICENSE_FILES:=Licenses/README
25
26 include $(INCLUDE_DIR)/package.mk
27
28 define uboot/Default
29 TITLE:=
30 CONFIG:=
31 endef
32
33 define uboot/ls1043ardb
34 TITLE:=U-Boot binary $(PKG_NAME)-$(PKG_VERSION) for NXP ls1043ardb 32b Dev Board
35 CONFIG=ls1043ardb-uboot.bin
36 endef
37
38 UBOOTS := \
39 ls1043ardb
40
41 define Package/uboot/template
42 define Package/uboot-layerscape-32b-$(1)
43 SECTION:=boot
44 CATEGORY:=Boot Loaders
45 DEPENDS:= @TARGET_layerscape_32b
46 TITLE:=$(2)
47 URL:=https://github.com/fsl-jyt/uboot-ls-32b.git
48 VARIANT:=$(1)
49 MAINTAINER:=Jiang Yutang <jiangyutang1978@gmail.com>
50 endef
51 endef
52
53 define BuildUBootPackage
54 $(eval $(uboot/Default))
55 $(eval $(uboot/$(1)))
56 $(call Package/uboot/template,$(1),$(TITLE))
57 endef
58
59 ifdef BUILD_VARIANT
60 $(eval $(call uboot/$(BUILD_VARIANT)))
61 UBOOT_CONFIG:=$(if $(CONFIG),$(CONFIG),$(BUILD_VARIANT))
62 endif
63
64 define Build/Configure
65 endef
66
67 define Build/Compile
68 endef
69
70 define Package/uboot/install/default
71 $(CP) $(PKG_BUILD_DIR)/$(UBOOT_CONFIG) $(KDIR)/$(1)-32b-uboot.bin
72 endef
73
74 define Package/uboot/install/template
75 define Package/uboot-layerscape-32b-$(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-layerscape-32b-$(u))) \
87 )