Module Name: src
Committed By: christos
Date: Sat Jul 15 15:20:52 UTC 2017
Modified Files:
src/sys/conf: Makefile.kern.inc
Added Files:
src/sys/conf: dts.mk
Log Message:
Move the dts rule to a separate file and add dependencies handling.
To generate a diff of this commit:
cvs rdiff -u -r1.259 -r1.260 src/sys/conf/Makefile.kern.inc
cvs rdiff -u -r0 -r1.1 src/sys/conf/dts.mk
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.259 src/sys/conf/Makefile.kern.inc:1.260
--- src/sys/conf/Makefile.kern.inc:1.259 Wed Jul 12 21:17:03 2017
+++ src/sys/conf/Makefile.kern.inc Sat Jul 15 11:20:52 2017
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile.kern.inc,v 1.259 2017/07/13 01:17:03 jmcneill Exp $
+# $NetBSD: Makefile.kern.inc,v 1.260 2017/07/15 15:20:52 christos Exp $
#
# This file contains common `MI' targets and definitions and it is included
# at the bottom of each `MD' ${MACHINE}/conf/Makefile.${MACHINE}.
@@ -321,6 +321,7 @@ ${_s:T:R}.o: ${_s}
.include "${S}/conf/cscope.mk"
.include "${S}/conf/gdbinit.mk"
.include "${S}/conf/ssp.mk"
+.include "${S}/conf/dts.mk"
##
## (7) misc targets: install, clean(dir), depend(all), lint, links, tags,
@@ -534,27 +535,6 @@ build_kernel: .USE
@${KCOMPILE.s} -pg
.endif # ___USE_SUFFIX_RULES___
-# Begin DTS handling
-
-DTSINC?=$S/external/gpl2/dts/dist/include
-DTSGNUPATH?=$S/external/gpl2/dts/dist/arch/${MACHINE_CPU}/boot/dts
-DTSPATH?=$S/arch/${MACHINE_CPU}/dts
-DTSPADDING?=1024
-
-.SUFFIXES: .dtb .dts
-.dts.dtb:
- ${CPP} -P -xassembler-with-cpp -I ${DTSINC} -I ${DTSPATH} -I ${DTSGNUPATH} \
- -include ${.IMPSRC} /dev/null | \
- ${TOOL_DTC} -i ${DTSINC} -i ${DTSPATH} -i ${DTSGNUPATH} -I dts -O dtb \
- -p ${DTSPADDING} -b 0 -o ${.TARGET}
-
-.PATH.dts: ${DTSPATH} ${DTSGNUPATH}
-
-DTB= ${DTS:.dts=.dtb}
-all: ${DTB}
-
-# End DTS handling
-
##
## the end
##
Added files:
Index: src/sys/conf/dts.mk
diff -u /dev/null src/sys/conf/dts.mk:1.1
--- /dev/null Sat Jul 15 11:20:52 2017
+++ src/sys/conf/dts.mk Sat Jul 15 11:20:52 2017
@@ -0,0 +1,26 @@
+# $NetBSD: dts.mk,v 1.1 2017/07/15 15:20:52 christos Exp $
+
+DTSINC?=$S/external/gpl2/dts/dist/include
+DTSGNUPATH?=$S/external/gpl2/dts/dist/arch/${MACHINE_CPU}/boot/dts
+DTSPATH?=$S/arch/${MACHINE_CPU}/dts
+DTSPADDING?=1024
+
+.SUFFIXES: .dtd .dtb .dts
+
+.dts.dtd:
+ ${TOOL_DTC} -i ${DTSINC} -i ${DTSPATH} -i ${DTSGNUPATH} -I dts -O dtb \
+ -p ${DTSPADDING} -b 0 -o /dev/null -d /dev/stdout ${.IMPSRC} | \
+ ${TOOL_SED} -e 's@/dev/null@${.TARGET:.dtd=.dtb}@' > ${.TARGET}
+
+.dts.dtb:
+ ${CPP} -P -xassembler-with-cpp -I ${DTSINC} -I ${DTSPATH} \
+ -I ${DTSGNUPATH} -include ${.IMPSRC} /dev/null | \
+ ${TOOL_DTC} -i ${DTSINC} -i ${DTSPATH} -i ${DTSGNUPATH} -I dts -O dtb \
+ -p ${DTSPADDING} -b 0 -o ${.TARGET}
+
+.PATH.dts: ${DTSPATH} ${DTSGNUPATH}
+
+DEPS+= ${DTS:.dts=.dtd}
+DTB= ${DTS:.dts=.dtb}
+
+all: ${DTB}