Source-Changes-HG archive

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

[src/trunk]: src/sys/conf Add support for building dts files from multiple pa...



details:   https://anonhg.NetBSD.org/src/rev/e698ec8a1a10
branches:  trunk
changeset: 356179:e698ec8a1a10
user:      jmcneill <jmcneill%NetBSD.org@localhost>
date:      Thu Sep 07 21:22:19 2017 +0000

description:
Add support for building dts files from multiple paths, idea from christos

diffstat:

 sys/conf/dts.mk |  40 +++++++++++++++++++++++++++-------------
 1 files changed, 27 insertions(+), 13 deletions(-)

diffs (63 lines):

diff -r 6e828ab2f34e -r e698ec8a1a10 sys/conf/dts.mk
--- a/sys/conf/dts.mk   Thu Sep 07 18:57:47 2017 +0000
+++ b/sys/conf/dts.mk   Thu Sep 07 21:22:19 2017 +0000
@@ -1,32 +1,46 @@
-# $NetBSD: dts.mk,v 1.2 2017/07/15 15:53:48 christos Exp $
+# $NetBSD: dts.mk,v 1.3 2017/09/07 21:22:19 jmcneill Exp $
+
+DTSARCH?=${MACHINE_CPU}
+DTSGNUARCH?=${DTSARCH}
+DTSPADDING?=1024
 
 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
+.for _arch in ${DTSARCH}
+DTSDIR+=$S/arch/${_arch}/dts
+.endfor
+.for _arch in ${DTSGNUARCH}
+DTSDIR+=$S/external/gpl2/dts/dist/arch/${_arch}/boot/dts
+.for _dir in ${DTSSUBDIR}
+.if exists($S/external/gpl2/dts/dist/arch/${_arch}/boot/dts/${_dir})
+DTSDIR+=$S/external/gpl2/dts/dist/arch/${_arch}/boot/dts/${_dir}
+.endif
+.endfor
+.endfor
+
+DTSPATH=${DTSINC} ${DTSDIR}
 
 .SUFFIXES: .dtd .dtb .dts
 
 .dts.dtd:
-       (${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 \
+       (${CPP} -P -xassembler-with-cpp ${DTSPATH:@v@-I ${v}@} \
+           -include ${.IMPSRC} /dev/null | \
+       ${TOOL_DTC} ${DTSPATH:@v@-i ${v}@} -I dts -O dtb \
            -p ${DTSPADDING} -b 0 -o /dev/null -d /dev/stdout | \
        ${TOOL_SED} -e 's@/dev/null@${.TARGET:.dtd=.dtb}@' \
            -e 's@<stdin>@${.IMPSRC}@' && \
-       ${CPP} -P -xassembler-with-cpp -I ${DTSINC} -I ${DTSPATH} \
-           -I ${DTSGNUPATH} -include ${.IMPSRC} -M /dev/null | \
+       ${CPP} -P -xassembler-with-cpp ${DTSPATH:@v@-I ${v}@} \
+           -include ${.IMPSRC} -M /dev/null | \
        ${TOOL_SED} -e 's@null.o@${.TARGET:.dtd=.dtb}@' \
            -e 's@/dev/null@@') > ${.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 \
+       ${CPP} -P -xassembler-with-cpp ${DTSPATH:@v@-I ${v}@} \
+           -include ${.IMPSRC} /dev/null | \
+       ${TOOL_DTC} ${DTSPATH:@v@-i ${v}@} -I dts -O dtb \
            -p ${DTSPADDING} -b 0 -o ${.TARGET}
 
-.PATH.dts: ${DTSPATH} ${DTSGNUPATH}
+.PATH.dts: ${DTSDIR}
 
 DEPS+= ${DTS:.dts=.dtd}
 DTB= ${DTS:.dts=.dtb}



Home | Main Index | Thread Index | Old Index