mirror of
https://github.com/AuxXxilium/linux_dsm_epyc7002.git
synced 2024-12-27 04:25:29 +07:00
9dffecc133
The dt_binding_check target is located outside of the 'ifneq ($(dtstree),) ... endif' block. So, you can run 'make dt_binding_check' on any architecture. This makes a perfect sense because the dt-schema is arch-agnostic. The only one problem I see is that scripts/dtc/dtc is not always built. For example, ARCH=x86 defconfig does not define CONFIG_DTC. Kbuild descends into scripts/dtc/ with doing nothing. Then, it fails to build *.example.dt.yaml files. Let's build scripts/dtc/dtc forcibly when running dt_binding_check. The dt-schema does not depend on any CONFIG option either, so you should be able to run dt_binding_check without the .config file. Going forward, you can directly run 'make dt_binding_check' in a pristine source tree. Signed-off-by: Masahiro Yamada <masahiroy@kernel.org> Reviewed-by: Rob Herring <robh@kernel.org>
32 lines
1.0 KiB
Makefile
32 lines
1.0 KiB
Makefile
# SPDX-License-Identifier: GPL-2.0
|
|
# scripts/dtc makefile
|
|
|
|
hostprogs := dtc
|
|
always-$(CONFIG_DTC) += $(hostprogs)
|
|
always-$(CHECK_DT_BINDING) += $(hostprogs)
|
|
|
|
dtc-objs := dtc.o flattree.o fstree.o data.o livetree.o treesource.o \
|
|
srcpos.o checks.o util.o
|
|
dtc-objs += dtc-lexer.lex.o dtc-parser.tab.o
|
|
|
|
# Source files need to get at the userspace version of libfdt_env.h to compile
|
|
HOST_EXTRACFLAGS := -I $(srctree)/$(src)/libfdt
|
|
|
|
ifeq ($(shell pkg-config --exists yaml-0.1 2>/dev/null && echo yes),)
|
|
ifneq ($(CHECK_DTBS),)
|
|
$(error dtc needs libyaml for DT schema validation support. \
|
|
Install the necessary libyaml development package.)
|
|
endif
|
|
HOST_EXTRACFLAGS += -DNO_YAML
|
|
else
|
|
dtc-objs += yamltree.o
|
|
HOSTLDLIBS_dtc := $(shell pkg-config yaml-0.1 --libs)
|
|
endif
|
|
|
|
# Generated files need one more search path to include headers in source tree
|
|
HOSTCFLAGS_dtc-lexer.lex.o := -I $(srctree)/$(src)
|
|
HOSTCFLAGS_dtc-parser.tab.o := -I $(srctree)/$(src)
|
|
|
|
# dependencies on generated files need to be listed explicitly
|
|
$(obj)/dtc-lexer.lex.o: $(obj)/dtc-parser.tab.h
|