Index: sys/conf/Makefile.amd64 =================================================================== --- sys/conf/Makefile.amd64 +++ sys/conf/Makefile.amd64 @@ -31,7 +31,7 @@ .endif .include "$S/conf/kern.pre.mk" -INCLUDES+= -I$S/contrib/libfdt +INCLUDES+= .if !empty(DDB_ENABLED) || !empty(DTR_ENABLED) || !empty(HWPMC_ENABLED) CFLAGS+= -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer Index: sys/conf/Makefile.arm =================================================================== --- sys/conf/Makefile.arm +++ sys/conf/Makefile.arm @@ -30,7 +30,8 @@ .endif .include "$S/conf/kern.pre.mk" -INCLUDES+= -I$S/contrib/libfdt -I$S/contrib/device-tree/include -I$$/dts/include +INCLUDES+= -I$S/contrib/device-tree/include +INCLUDES+= -I$$/dts/include LINUX_DTS_VERSION!= awk '/freebsd,dts-version/ { sub(/;$$/,"", $$NF); print $$NF }' $S/dts/freebsd-compatible.dts CFLAGS += -DLINUX_DTS_VERSION=\"${LINUX_DTS_VERSION}\" Index: sys/conf/Makefile.arm64 =================================================================== --- sys/conf/Makefile.arm64 +++ sys/conf/Makefile.arm64 @@ -25,7 +25,7 @@ .endif .include "$S/conf/kern.pre.mk" -INCLUDES+= -I$S/contrib/libfdt -I$S/contrib/device-tree/include +INCLUDES+= -I$S/contrib/device-tree/include LINUX_DTS_VERSION!= awk '/freebsd,dts-version/ { sub(/;$$/,"", $$NF); print $$NF }' $S/dts/freebsd-compatible.dts CFLAGS += -DLINUX_DTS_VERSION=\"${LINUX_DTS_VERSION}\" Index: sys/conf/Makefile.i386 =================================================================== --- sys/conf/Makefile.i386 +++ sys/conf/Makefile.i386 @@ -30,7 +30,7 @@ .endif .include "$S/conf/kern.pre.mk" -INCLUDES+= -I$S/contrib/libfdt +INCLUDES+= %BEFORE_DEPEND Index: sys/conf/Makefile.mips =================================================================== --- sys/conf/Makefile.mips +++ sys/conf/Makefile.mips @@ -28,7 +28,7 @@ .endif .include "$S/conf/kern.pre.mk" -INCLUDES+= -I$S/contrib/libfdt -I$S/contrib/device-tree/include +INCLUDES+= -I$S/contrib/device-tree/include LDSCRIPT_NAME?=ldscript.$M SYSTEM_LD:= ${SYSTEM_LD:$S/conf/${LDSCRIPT_NAME}=${LDSCRIPT_NAME}} Index: sys/conf/Makefile.powerpc =================================================================== --- sys/conf/Makefile.powerpc +++ sys/conf/Makefile.powerpc @@ -33,7 +33,7 @@ .include "$S/conf/kern.pre.mk" -INCLUDES+= -I$S/contrib/libfdt +INCLUDES+= .if "${MACHINE_ARCH}" == "powerpcspe" # Force __SPE__, since the builtin will be removed later with -mno-spe Index: sys/conf/Makefile.riscv =================================================================== --- sys/conf/Makefile.riscv +++ sys/conf/Makefile.riscv @@ -26,7 +26,7 @@ .endif .include "$S/conf/kern.pre.mk" -INCLUDES+= -I$S/contrib/libfdt -I$S/contrib/device-tree/include +INCLUDES+= -I$S/contrib/device-tree/include # Set the ELF LMA to the address that OpenSBI's fw_jump jumps to. This allows # us to load the kernel with the -kernel flag in QEMU without having to embed Index: sys/conf/kern.pre.mk =================================================================== --- sys/conf/kern.pre.mk +++ sys/conf/kern.pre.mk @@ -67,7 +67,9 @@ .endif NOSTDINC= -nostdinc -INCLUDES= ${NOSTDINC} ${INCLMAGIC} -I. -I$S -I$S/contrib/ck/include +INCLUDES= ${NOSTDINC} ${INCLMAGIC} -I. -I$S +INCLUDES+= -I$S/contrib/ck/include +INCLUDES+= -I$S/contrib/libfdt CFLAGS= ${COPTFLAGS} ${DEBUG} CFLAGS+= ${INCLUDES} -D_KERNEL -DHAVE_KERNEL_OPTION_HEADERS -include opt_global.h