1 include $(INCLUDE_DIR
)/prereq.mk
5 ifndef PKG_SOURCE_PROTO
6 PKG_SOURCE
= $(PKG_NAME
)-$(PKG_VERSION
).
tar.bz2
8 https
://mirror.cyberbits.eu
/u-boot \
9 https
://ftp.denx.de
/pub
/u-boot \
10 ftp
://ftp.denx.de
/pub
/u-boot
13 PKG_BUILD_DIR
= $(BUILD_DIR
)/$(PKG_NAME
)-$(BUILD_VARIANT
)/$(PKG_NAME
)-$(PKG_VERSION
)
18 PKG_LICENSE
:=GPL-2.0 GPL-2.0
+
19 PKG_LICENSE_FILES
:=Licenses
/README
21 PKG_BUILD_PARALLEL ?
= 1
23 ifdef UBOOT_USE_BINMAN
24 $(eval
$(call TestHostCommand
,python3-pyelftools
, \
25 Please
install the Python3 elftools module
, \
26 $(STAGING_DIR_HOST
)/bin
/python3
-c
'import elftools'))
29 ifdef UBOOT_USE_INTREE_DTC
30 $(eval
$(call TestHostCommand
,python3-dev
, \
31 Please
install the python3-dev package
, \
32 python3.11
-config
--includes
2>&1 | grep
'python3', \
33 python3.10
-config
--includes
2>&1 | grep
'python3', \
34 python3.9
-config
--includes
2>&1 | grep
'python3', \
35 python3.8
-config
--includes
2>&1 | grep
'python3', \
36 python3.7
-config
--includes
2>&1 | grep
'python3', \
37 python3-config
--includes
2>&1 | grep
-E
'python3\.([7-9]|[0-9][0-9])\.?'))
39 $(eval
$(call TestHostCommand
,python3-setuptools
, \
40 Please
install the Python3 setuptools module
, \
41 $(STAGING_DIR_HOST
)/bin
/python3
-c
'import setuptools'))
43 $(eval
$(call TestHostCommand
,swig
, \
44 Please
install the swig package
, \
48 export GCC_HONOUR_COPTS
=s
50 define Package
/u-boot
/install/default
51 $(CP
) $(patsubst %,$(PKG_BUILD_DIR
)/%,$(UBOOT_IMAGE
)) $(1)/
54 Package
/u-boot
/install = $(Package
/u-boot
/install/default
)
66 UBOOT_IMAGE
:=u-boot.bin
69 TARGET_DEP
= TARGET_
$(BUILD_TARGET
)$(if
$(BUILD_SUBTARGET
),_
$(BUILD_SUBTARGET
))
73 HOSTCFLAGS
="$(HOST_CFLAGS) $(HOST_CPPFLAGS) -std=gnu11" \
74 HOSTLDFLAGS
="$(HOST_LDFLAGS)" \
75 LOCALVERSION
="-OpenWrt-$(REVISION)" \
76 STAGING_PREFIX
="$(STAGING_DIR_HOST)" \
77 PKG_CONFIG_PATH
="$(STAGING_DIR_HOST)/lib/pkgconfig" \
78 PKG_CONFIG_LIBDIR
="$(STAGING_DIR_HOST)/lib/pkgconfig" \
79 PKG_CONFIG_EXTRAARGS
="--static" \
80 $(if
$(findstring c
,$(OPENWRT_VERBOSE
)),V
=1,V
='')
82 define Build
/U-Boot
/Target
83 $(eval
$(call U-Boot
/Init
,$(1)))
84 $(eval
$(call U-Boot
/Default
,$(1)))
85 $(eval
$(call U-Boot
/$(1),$(1)))
87 define Package
/u-boot-
$(1)
89 CATEGORY
:=Boot Loaders
90 TITLE
:=U-Boot for
$(NAME
)
92 DEPENDS
:=@
!IN_SDK
$(DEPENDS
)
94 ifneq ($(BUILD_TARGET
),)
95 DEPENDS
+= @
$(TARGET_DEP
)
96 ifneq ($(BUILD_DEVICES
),)
97 DEFAULT
:= y if
($(TARGET_DEP
)_Default \
98 $(patsubst %,||
$(TARGET_DEP
)_DEVICE_
%,$(BUILD_DEVICES
)) \
99 $(patsubst %,||
$(patsubst TARGET_
%,TARGET_DEVICE_
%,$(TARGET_DEP
))_DEVICE_
%,$(BUILD_DEVICES
)))
102 $(if
$(DEFAULT
),DEFAULT
:=$(DEFAULT
))
103 URL
:=http
://www.denx.de
/wiki
/U-Boot
106 define Package
/u-boot-
$(1)/install
107 $$(Package
/u-boot
/install)
111 define Build
/Configure
/U-Boot
112 +$(MAKE
) $(PKG_JOBS
) -C
$(PKG_BUILD_DIR
) $(UBOOT_CONFIGURE_VARS
) $(UBOOT_CONFIG
)_config
113 $(if
$(strip $(UBOOT_CUSTOMIZE_CONFIG
)),
114 $(PKG_BUILD_DIR
)/scripts
/config
--file
$(PKG_BUILD_DIR
)/.config
$(UBOOT_CUSTOMIZE_CONFIG
)
115 +$(MAKE
) $(PKG_JOBS
) -C
$(PKG_BUILD_DIR
) $(UBOOT_CONFIGURE_VARS
) oldconfig
)
118 ifndef UBOOT_USE_INTREE_DTC
119 DTC
=$(wildcard $(LINUX_DIR
)/scripts
/dtc
/dtc
)
122 define Build
/Compile
/U-Boot
123 +$(MAKE
) $(PKG_JOBS
) -C
$(PKG_BUILD_DIR
) \
124 CROSS_COMPILE
=$(TARGET_CROSS
) \
125 $(if
$(DTC
),DTC
="$(DTC)") \
129 define BuildPackage
/U-Boot
/Defaults
130 Build
/Configure
/Default
= $$$$(Build
/Configure
/U-Boot
)
131 Build
/Compile
/Default
= $$$$(Build
/Compile
/U-Boot
)
134 define BuildPackage
/U-Boot
135 $(eval
$(call BuildPackage
/U-Boot
/Defaults
))
136 $(foreach type
,$(if
$(DUMP
),$(UBOOT_TARGETS
),$(BUILD_VARIANT
)), \
137 $(eval
$(call Build
/U-Boot
/Target
,$(type
)))
139 $(eval
$(call Build
/DefaultTargets
))
140 $(foreach type
,$(if
$(DUMP
),$(UBOOT_TARGETS
),$(BUILD_VARIANT
)), \
141 $(call BuildPackage
,u-boot-
$(type
))