96168a30d08c088720e3548f4d0c700244e36a06
[openwrt/staging/mkresin.git] / package / boot / uboot-omap / Makefile
1 #
2 # Copyright (C) 2012-2013 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
10 PKG_NAME:=u-boot
11 PKG_VERSION:=2013.10
12 PKG_RELEASE:=1
13
14 PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(BUILD_VARIANT)/$(PKG_NAME)-$(PKG_VERSION)
15 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
16 PKG_SOURCE_URL:= \
17 http://mirror2.openwrt.org/sources \
18 ftp://ftp.denx.de/pub/u-boot
19 PKG_MD5SUM:=a076a044b64371edc52f7e562b13f6b2
20 PKG_TARGETS:=bin
21
22 include $(INCLUDE_DIR)/package.mk
23
24 define uboot/Default
25 TITLE:=
26 CONFIG:=
27 IMAGE:=
28 endef
29
30 define uboot/omap4_panda
31 TITLE:=U-Boot for the Pandaboard
32 endef
33
34 define uboot/am335x_evm
35 TITLE:=U-Boot for the AM335x EVM
36 endef
37
38 define uboot/omap3_overo
39 TITLE:=U-Boot for the Gumstix Overo
40 endef
41
42 define uboot/omap3_beagle
43 TITLE:=U-Boot for the BeagleBoard
44 endef
45
46 UBOOTS:=omap4_panda am335x_evm omap3_overo omap3_beagle
47
48 define Package/uboot/template
49 define Package/uboot-omap-$(1)
50 SECTION:=boot
51 CATEGORY:=Boot Loaders
52 DEPENDS:=@TARGET_omap
53 TITLE:=$(2)
54 URL:=http://www.denx.de/wiki/U-Boot
55 VARIANT:=$(1)
56 HIDDEN:=1
57 endef
58 endef
59
60 define BuildUBootPackage
61 $(eval $(uboot/Default))
62 $(eval $(uboot/$(1)))
63 $(call Package/uboot/template,$(1),$(TITLE))
64 endef
65
66 ifdef BUILD_VARIANT
67 $(eval $(call uboot/$(BUILD_VARIANT)))
68 UBOOT_CONFIG:=$(if $(CONFIG),$(CONFIG),$(BUILD_VARIANT))
69 UBOOT_IMAGE:=$(if $(IMAGE),$(IMAGE),openwrt-$(BOARD)-$(BUILD_VARIANT)-u-boot.img)
70 endif
71
72 define Build/Configure
73 $(MAKE) -C $(PKG_BUILD_DIR) \
74 USE_PRIVATE_LIBGCC=yes $(UBOOT_CONFIG)_config
75 endef
76
77 define Build/Compile
78 $(MAKE) -C $(PKG_BUILD_DIR) \
79 CROSS_COMPILE=$(TARGET_CROSS)
80 endef
81
82 define Package/uboot/install/default
83 $(INSTALL_DIR) $(BIN_DIR)/uboot-$(BOARD)-$(1)
84 $(CP) $(PKG_BUILD_DIR)/u-boot.img $(BIN_DIR)/uboot-$(BOARD)-$(1)/u-boot.img
85 $(CP) $(PKG_BUILD_DIR)/MLO $(BIN_DIR)/uboot-$(BOARD)-$(1)/MLO
86 endef
87
88 define Package/uboot/install/template
89 define Package/uboot-omap-$(1)/install
90 $(call Package/uboot/install/default,$(2))
91 endef
92 endef
93
94 $(foreach u,$(UBOOTS), \
95 $(eval $(call Package/uboot/install/template,$(u),$(u))) \
96 )
97
98 $(foreach u,$(UBOOTS), \
99 $(eval $(call BuildUBootPackage,$(u))) \
100 $(eval $(call BuildPackage,uboot-omap-$(u))) \
101 )