Module Name: src
Committed By: jmcneill
Date: Thu Jun 15 21:41:01 UTC 2017
Modified Files:
src/sys/conf: Makefile.kern.inc
Log Message:
Add support for building DTB files during kernel build, from christos.
To generate a diff of this commit:
cvs rdiff -u -r1.256 -r1.257 src/sys/conf/Makefile.kern.inc
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/sys/conf/Makefile.kern.inc
diff -u src/sys/conf/Makefile.kern.inc:1.256 src/sys/conf/Makefile.kern.inc:1.257
--- src/sys/conf/Makefile.kern.inc:1.256 Wed Jan 11 12:19:43 2017
+++ src/sys/conf/Makefile.kern.inc Thu Jun 15 21:41:01 2017
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile.kern.inc,v 1.256 2017/01/11 12:19:43 joerg Exp $
+# $NetBSD: Makefile.kern.inc,v 1.257 2017/06/15 21:41:01 jmcneill Exp $
#
# This file contains common `MI' targets and definitions and it is included
# at the bottom of each `MD' ${MACHINE}/conf/Makefile.${MACHINE}.
@@ -534,6 +534,25 @@ build_kernel: .USE
@${KCOMPILE.s} -pg
.endif # ___USE_SUFFIX_RULES___
+# Begin DTS handling
+
+DTSINC?=$S/external/gpl2/dts/dist/include
+DTSPATH?=$S/external/gpl2/dts/dist/arch/${MACHINE_CPU}/boot/dts
+DTSPADDING?=1024
+
+.SUFFIXES: .dtb .dts
+.dts.dtb:
+ ${CPP} -P -xassembler-with-cpp -I ${DTSINC} -I ${DTSPATH} \
+ -include ${.IMPSRC} /dev/null | \
+ ${TOOL_DTC} -i ${DTSINC} -i ${DTSPATH} -I dts -O dtb \
+ -p ${DTSPADDING} -b 0 -o ${.TARGET}
+
+.PATH.dts: ${DTSPATH}
+
+all: ${DTS:.dts=.dtb}
+
+# End DTS handling
+
##
## the end
##