Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/conf Move the dts rule to a separate file and add depend...



details:   https://anonhg.NetBSD.org/src/rev/3a11dbb5b1d0
branches:  trunk
changeset: 355161:3a11dbb5b1d0
user:      christos <christos%NetBSD.org@localhost>
date:      Sat Jul 15 15:20:52 2017 +0000

description:
Move the dts rule to a separate file and add dependencies handling.

diffstat:

 sys/conf/Makefile.kern.inc |  24 ++----------------------
 sys/conf/dts.mk            |  26 ++++++++++++++++++++++++++
 2 files changed, 28 insertions(+), 22 deletions(-)

diffs (75 lines):

diff -r c2bc82cde2f1 -r 3a11dbb5b1d0 sys/conf/Makefile.kern.inc
--- a/sys/conf/Makefile.kern.inc        Sat Jul 15 14:40:36 2017 +0000
+++ b/sys/conf/Makefile.kern.inc        Sat Jul 15 15:20:52 2017 +0000
@@ -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 @@
 .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 @@
        @${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
 ##
diff -r c2bc82cde2f1 -r 3a11dbb5b1d0 sys/conf/dts.mk
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/sys/conf/dts.mk   Sat Jul 15 15:20:52 2017 +0000
@@ -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}



Home | Main Index | Thread Index | Old Index