df9781a420
This would should up as `$$(HOSTCPPFLAGS)` in the host CFLAGS. ``` make --jobserver-fds=3,4 -j -C <openwrt>/build_dir/target-arm_cortex-a8+vfpv3_musl_eabi/u-boot-A10-OLinuXino-Lime/u-boot-2017.07 CROSS_COMPILE=arm-openwrt-linux-muslgnueabi- DTC="<openwrt>/build_dir/target-arm_cortex-a8+vfpv3_musl_eabi/linux-sunxi_cortexa8/linux-4.9.76/scripts/dtc/dtc" HOSTCC="gcc" HOSTCFLAGS='-O2 -I<openwrt>/staging_dir/host/include -I<openwrt>/staging_dir/host/usr/include -I<openwrt>/staging_dir/hostpkg/include -I<openwrt>/staging_dir/target-arm_cortex-a8+vfpv3_musl_eabi/host/include $$(HOSTCPPFLAGS)' HOSTLDFLAGS="" BL31=<openwrt>/staging_dir/target-arm_cortex-a8+vfpv3_musl_eabi/image/bl31.bin ``` And then it would complain with: ``` /bin/sh: 1: HOSTCPPFLAGS: not found ``` Also, HOSTCPPFLAGS does not exist. The correct var is HOST_CPPFLAGS. Signed-off-by: Alexandru Ardelean <ardeleanalex@gmail.com>
104 lines
2.6 KiB
Makefile
104 lines
2.6 KiB
Makefile
PKG_NAME ?= u-boot
|
|
|
|
ifndef PKG_SOURCE_PROTO
|
|
PKG_SOURCE = $(PKG_NAME)-$(PKG_VERSION).tar.bz2
|
|
PKG_SOURCE_URL = \
|
|
http://sources.lede-project.org \
|
|
ftp://ftp.denx.de/pub/u-boot
|
|
endif
|
|
|
|
PKG_BUILD_DIR = $(BUILD_DIR)/$(PKG_NAME)-$(BUILD_VARIANT)/$(PKG_NAME)-$(PKG_VERSION)
|
|
|
|
PKG_TARGETS := bin
|
|
PKG_FLAGS:=nonshared
|
|
|
|
PKG_LICENSE:=GPL-2.0 GPL-2.0+
|
|
PKG_LICENSE_FILES:=Licenses/README
|
|
|
|
PKG_BUILD_PARALLEL:=1
|
|
|
|
export GCC_HONOUR_COPTS=s
|
|
|
|
define Package/u-boot/install/default
|
|
$(CP) $(patsubst %,$(PKG_BUILD_DIR)/%,$(UBOOT_IMAGE)) $(1)/
|
|
endef
|
|
|
|
Package/u-boot/install = $(Package/u-boot/install/default)
|
|
|
|
define U-Boot/Init
|
|
BUILD_TARGET:=
|
|
BUILD_SUBTARGET:=
|
|
BUILD_DEVICES:=
|
|
NAME:=
|
|
DEPENDS:=
|
|
HIDDEN:=
|
|
DEFAULT:=
|
|
VARIANT:=$(1)
|
|
UBOOT_CONFIG:=$(1)
|
|
UBOOT_IMAGE:=u-boot.bin
|
|
endef
|
|
|
|
TARGET_DEP = TARGET_$(BUILD_TARGET)$(if $(BUILD_SUBTARGET),_$(BUILD_SUBTARGET))
|
|
|
|
UBOOT_MAKE_FLAGS = \
|
|
HOSTCC="$(HOSTCC)" \
|
|
HOSTCFLAGS="$(HOST_CFLAGS) $(HOST_CPPFLAGS)" \
|
|
HOSTLDFLAGS=""
|
|
|
|
define Build/U-Boot/Target
|
|
$(eval $(call U-Boot/Init,$(1)))
|
|
$(eval $(call U-Boot/Default,$(1)))
|
|
$(eval $(call U-Boot/$(1),$(1)))
|
|
|
|
define Package/u-boot-$(1)
|
|
SECTION:=boot
|
|
CATEGORY:=Boot Loaders
|
|
TITLE:=U-Boot for $(NAME)
|
|
VARIANT:=$(VARIANT)
|
|
DEPENDS:=@!IN_SDK $(DEPENDS)
|
|
HIDDEN:=$(HIDDEN)
|
|
ifneq ($(BUILD_TARGET),)
|
|
DEPENDS += @$(TARGET_DEP)
|
|
ifneq ($(BUILD_DEVICES),)
|
|
DEFAULT := y if ($(TARGET_DEP)_Default \
|
|
$(patsubst %,|| $(TARGET_DEP)_DEVICE_%,$(BUILD_DEVICES)) \
|
|
$(patsubst %,|| $(patsubst TARGET_%,TARGET_DEVICE_%,$(TARGET_DEP))_DEVICE_%,$(BUILD_DEVICES)))
|
|
endif
|
|
endif
|
|
$(if $(DEFAULT),DEFAULT:=$(DEFAULT))
|
|
URL:=http://www.denx.de/wiki/U-Boot
|
|
endef
|
|
|
|
define Package/u-boot-$(1)/install
|
|
$$(Package/u-boot/install)
|
|
endef
|
|
endef
|
|
|
|
define Build/Configure/U-Boot
|
|
+$(MAKE) $(PKG_JOBS) -C $(PKG_BUILD_DIR) $(UBOOT_CONFIGURE_VARS) $(UBOOT_CONFIG)_config
|
|
endef
|
|
|
|
DTC=$(wildcard $(LINUX_DIR)/scripts/dtc/dtc)
|
|
|
|
define Build/Compile/U-Boot
|
|
+$(MAKE) $(PKG_JOBS) -C $(PKG_BUILD_DIR) \
|
|
CROSS_COMPILE=$(TARGET_CROSS) \
|
|
$(if $(DTC),DTC="$(DTC)") \
|
|
$(UBOOT_MAKE_FLAGS)
|
|
endef
|
|
|
|
define BuildPackage/U-Boot/Defaults
|
|
Build/Configure/Default = $$$$(Build/Configure/U-Boot)
|
|
Build/Compile/Default = $$$$(Build/Compile/U-Boot)
|
|
endef
|
|
|
|
define BuildPackage/U-Boot
|
|
$(eval $(call BuildPackage/U-Boot/Defaults))
|
|
$(foreach type,$(if $(DUMP),$(UBOOT_TARGETS),$(BUILD_VARIANT)), \
|
|
$(eval $(call Build/U-Boot/Target,$(type)))
|
|
)
|
|
$(eval $(call Build/DefaultTargets))
|
|
$(foreach type,$(if $(DUMP),$(UBOOT_TARGETS),$(BUILD_VARIANT)), \
|
|
$(call BuildPackage,u-boot-$(type))
|
|
)
|
|
endef
|