diff options
Diffstat (limited to 'scripts/dtc/Makefile')
-rw-r--r-- | scripts/dtc/Makefile | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/scripts/dtc/Makefile b/scripts/dtc/Makefile index 1c943e03eaf2..056d5da6c477 100644 --- a/scripts/dtc/Makefile +++ b/scripts/dtc/Makefile | |||
@@ -1,7 +1,7 @@ | |||
1 | # SPDX-License-Identifier: GPL-2.0 | 1 | # SPDX-License-Identifier: GPL-2.0 |
2 | # scripts/dtc makefile | 2 | # scripts/dtc makefile |
3 | 3 | ||
4 | hostprogs-y := dtc | 4 | hostprogs-$(CONFIG_DTC) := dtc |
5 | always := $(hostprogs-y) | 5 | always := $(hostprogs-y) |
6 | 6 | ||
7 | dtc-objs := dtc.o flattree.o fstree.o data.o livetree.o treesource.o \ | 7 | dtc-objs := dtc.o flattree.o fstree.o data.o livetree.o treesource.o \ |
@@ -11,6 +11,13 @@ dtc-objs += dtc-lexer.lex.o dtc-parser.tab.o | |||
11 | # Source files need to get at the userspace version of libfdt_env.h to compile | 11 | # Source files need to get at the userspace version of libfdt_env.h to compile |
12 | HOST_EXTRACFLAGS := -I$(src)/libfdt | 12 | HOST_EXTRACFLAGS := -I$(src)/libfdt |
13 | 13 | ||
14 | ifeq ($(wildcard /usr/include/yaml.h),) | ||
15 | HOST_EXTRACFLAGS += -DNO_YAML | ||
16 | else | ||
17 | dtc-objs += yamltree.o | ||
18 | HOSTLDLIBS_dtc := -lyaml | ||
19 | endif | ||
20 | |||
14 | # Generated files need one more search path to include headers in source tree | 21 | # Generated files need one more search path to include headers in source tree |
15 | HOSTCFLAGS_dtc-lexer.lex.o := -I$(src) | 22 | HOSTCFLAGS_dtc-lexer.lex.o := -I$(src) |
16 | HOSTCFLAGS_dtc-parser.tab.o := -I$(src) | 23 | HOSTCFLAGS_dtc-parser.tab.o := -I$(src) |