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
))
72 PATH
=$(STAGING_DIR_HOST
)/bin
:$(PATH
) \
74 HOSTCFLAGS
="$(HOST_CFLAGS) $(HOST_CPPFLAGS) -std=gnu11" \
75 HOSTLDFLAGS
="$(HOST_LDFLAGS)" \
76 LOCALVERSION
="-OpenWrt-$(REVISION)" \
77 STAGING_PREFIX
="$(STAGING_DIR_HOST)" \
78 PKG_CONFIG_PATH
="$(STAGING_DIR_HOST)/lib/pkgconfig" \
79 PKG_CONFIG_LIBDIR
="$(STAGING_DIR_HOST)/lib/pkgconfig" \
80 PKG_CONFIG_EXTRAARGS
="--static" \
81 $(if
$(findstring c
,$(OPENWRT_VERBOSE
)),V
=1,V
='')
83 define Build
/U-Boot
/Target
84 $(eval
$(call U-Boot
/Init
,$(1)))
85 $(eval
$(call U-Boot
/Default
,$(1)))
86 $(eval
$(call U-Boot
/$(1),$(1)))
88 define Package
/u-boot-
$(1)
90 CATEGORY
:=Boot Loaders
91 TITLE
:=U-Boot for
$(NAME
)
93 DEPENDS
:=@
!IN_SDK
$(DEPENDS
)
95 ifneq ($(BUILD_TARGET
),)
96 DEPENDS
+= @
$(TARGET_DEP
)
97 ifneq ($(BUILD_DEVICES
),)
98 DEFAULT
:= y if
($(TARGET_DEP
)_Default \
99 $(patsubst %,||
$(TARGET_DEP
)_DEVICE_
%,$(BUILD_DEVICES
)) \
100 $(patsubst %,||
$(patsubst TARGET_
%,TARGET_DEVICE_
%,$(TARGET_DEP
))_DEVICE_
%,$(BUILD_DEVICES
)))
103 $(if
$(DEFAULT
),DEFAULT
:=$(DEFAULT
))
104 URL
:=http
://www.denx.de
/wiki
/U-Boot
107 define Package
/u-boot-
$(1)/install
108 $$(Package
/u-boot
/install)
112 define Build
/Configure
/U-Boot
113 +$(MAKE
) $(PKG_JOBS
) -C
$(PKG_BUILD_DIR
) $(UBOOT_CONFIGURE_VARS
) $(UBOOT_CONFIG
)_config
114 $(if
$(strip $(UBOOT_CUSTOMIZE_CONFIG
)),
115 $(PKG_BUILD_DIR
)/scripts
/config
--file
$(PKG_BUILD_DIR
)/.config
$(UBOOT_CUSTOMIZE_CONFIG
)
116 +$(MAKE
) $(PKG_JOBS
) -C
$(PKG_BUILD_DIR
) $(UBOOT_CONFIGURE_VARS
) oldconfig
)
119 ifndef UBOOT_USE_INTREE_DTC
120 DTC
=$(wildcard $(LINUX_DIR
)/scripts
/dtc
/dtc
)
123 define Build
/Compile
/U-Boot
124 +$(MAKE
) $(PKG_JOBS
) -C
$(PKG_BUILD_DIR
) \
125 CROSS_COMPILE
=$(TARGET_CROSS
) \
126 $(if
$(DTC
),DTC
="$(DTC)") \
130 define BuildPackage
/U-Boot
/Defaults
131 Build
/Configure
/Default
= $$$$(Build
/Configure
/U-Boot
)
132 Build
/Compile
/Default
= $$$$(Build
/Compile
/U-Boot
)
135 define BuildPackage
/U-Boot
136 $(eval
$(call BuildPackage
/U-Boot
/Defaults
))
137 $(foreach type
,$(if
$(DUMP
),$(UBOOT_TARGETS
),$(BUILD_VARIANT
)), \
138 $(eval
$(call Build
/U-Boot
/Target
,$(type
)))
140 $(eval
$(call Build
/DefaultTargets
))
141 $(foreach type
,$(if
$(DUMP
),$(UBOOT_TARGETS
),$(BUILD_VARIANT
)), \
142 $(call BuildPackage
,u-boot-
$(type
))