aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Makefile9
-rw-r--r--doc/build/tools.rst9
-rw-r--r--scripts/dtc/Makefile2
3 files changed, 20 insertions, 0 deletions
diff --git a/Makefile b/Makefile
index 9be24c4ec61..efbaf434df4 100644
--- a/Makefile
+++ b/Makefile
@@ -485,6 +485,15 @@ export RCS_FIND_IGNORE := \( -name SCCS -o -name BitKeeper -o -name .svn -o \
export RCS_TAR_IGNORE := --exclude SCCS --exclude BitKeeper --exclude .svn \
--exclude CVS --exclude .pc --exclude .hg --exclude .git
+export PYTHON_ENABLE
+
+# This is y if U-Boot should not build any Python tools or libraries. Typically
+# you would need to set this if those tools/libraries (typically binman and
+# pylibfdt) cannot be built by your environment and are provided separately.
+ifeq ($(NO_PYTHON),)
+PYTHON_ENABLE=y
+endif
+
# ===========================================================================
# Rules shared between *config targets and build targets
diff --git a/doc/build/tools.rst b/doc/build/tools.rst
index ec017229258..5bfa05b2325 100644
--- a/doc/build/tools.rst
+++ b/doc/build/tools.rst
@@ -45,3 +45,12 @@ Launch the MSYS2 shell of the MSYS2 environment, and do the following::
$ make tools-only_defconfig
$ make tools-only
+
+
+Building without Python
+-----------------------
+
+The tools-only builds bytes pylibfdt by default. To disable this, use the
+NO_PYTHON variable::
+
+ NO_PYTHON=1 make tools-only_defconfig tools-only
diff --git a/scripts/dtc/Makefile b/scripts/dtc/Makefile
index 58d879dd11f..faa72d95e28 100644
--- a/scripts/dtc/Makefile
+++ b/scripts/dtc/Makefile
@@ -19,4 +19,6 @@ HOSTCFLAGS_dtc-parser.tab.o := -I$(src)
$(obj)/dtc-lexer.lex.o: $(obj)/dtc-parser.tab.h
# Added for U-Boot
+ifeq ($(PYTHON_ENABLE),y)
subdir-$(CONFIG_PYLIBFDT) += pylibfdt
+endif