3 ifndef PKG_SOURCE_PROTO
4 PKG_SOURCE = $(PKG_NAME)-$(PKG_VERSION).tar.bz2
6 https://sources.openwrt.org \
7 ftp://ftp.denx.de/pub/u-boot
10 PKG_BUILD_DIR = $(BUILD_DIR)/$(PKG_NAME)-$(BUILD_VARIANT)/$(PKG_NAME)-$(PKG_VERSION)
15 PKG_LICENSE:=GPL-2.0 GPL-2.0+
16 PKG_LICENSE_FILES:=Licenses/README
20 export GCC_HONOUR_COPTS=s
22 define Package/u-boot/install/default
23 $(CP) $(patsubst %,$(PKG_BUILD_DIR)/%,$(UBOOT_IMAGE)) $(1)/
26 Package/u-boot/install = $(Package/u-boot/install/default)
38 UBOOT_IMAGE:=u-boot.bin
41 TARGET_DEP = TARGET_$(BUILD_TARGET)$(if $(BUILD_SUBTARGET),_$(BUILD_SUBTARGET))
45 HOSTCFLAGS="$(HOST_CFLAGS) $(HOST_CPPFLAGS) -std=gnu11" \
46 HOSTLDFLAGS="$(HOST_LDFLAGS)"
48 define Build/U-Boot/Target
49 $(eval $(call U-Boot/Init,$(1)))
50 $(eval $(call U-Boot/Default,$(1)))
51 $(eval $(call U-Boot/$(1),$(1)))
53 define Package/u-boot-$(1)
55 CATEGORY:=Boot Loaders
56 TITLE:=U-Boot for $(NAME)
58 DEPENDS:=@!IN_SDK $(DEPENDS)
60 ifneq ($(BUILD_TARGET),)
61 DEPENDS += @$(TARGET_DEP)
62 ifneq ($(BUILD_DEVICES),)
63 DEFAULT := y if ($(TARGET_DEP)_Default \
64 $(patsubst %,|| $(TARGET_DEP)_DEVICE_%,$(BUILD_DEVICES)) \
65 $(patsubst %,|| $(patsubst TARGET_%,TARGET_DEVICE_%,$(TARGET_DEP))_DEVICE_%,$(BUILD_DEVICES)))
68 $(if $(DEFAULT),DEFAULT:=$(DEFAULT))
69 URL:=http://www.denx.de/wiki/U-Boot
72 define Package/u-boot-$(1)/install
73 $$(Package/u-boot/install)
77 define Build/Configure/U-Boot
78 +$(MAKE) $(PKG_JOBS) -C $(PKG_BUILD_DIR) $(UBOOT_CONFIGURE_VARS) $(UBOOT_CONFIG)_config
81 DTC=$(wildcard $(LINUX_DIR)/scripts/dtc/dtc)
83 define Build/Compile/U-Boot
84 +$(MAKE) $(PKG_JOBS) -C $(PKG_BUILD_DIR) \
85 CROSS_COMPILE=$(TARGET_CROSS) \
86 $(if $(DTC),DTC="$(DTC)") \
90 define BuildPackage/U-Boot/Defaults
91 Build/Configure/Default = $$$$(Build/Configure/U-Boot)
92 Build/Compile/Default = $$$$(Build/Compile/U-Boot)
95 define BuildPackage/U-Boot
96 $(eval $(call BuildPackage/U-Boot/Defaults))
97 $(foreach type,$(if $(DUMP),$(UBOOT_TARGETS),$(BUILD_VARIANT)), \
98 $(eval $(call Build/U-Boot/Target,$(type)))
100 $(eval $(call Build/DefaultTargets))
101 $(foreach type,$(if $(DUMP),$(UBOOT_TARGETS),$(BUILD_VARIANT)), \
102 $(call BuildPackage,u-boot-$(type))