Home | History | Annotate | Line # | Download | only in conf
dts.mk revision 1.5
      1  1.5  christos # $NetBSD: dts.mk,v 1.5 2017/12/03 17:07:18 christos Exp $
      2  1.3  jmcneill 
      3  1.3  jmcneill DTSARCH?=${MACHINE_CPU}
      4  1.3  jmcneill DTSGNUARCH?=${DTSARCH}
      5  1.3  jmcneill DTSPADDING?=1024
      6  1.1  christos 
      7  1.4  christos .BEGIN:
      8  1.4  christos 	@mkdir -p dts
      9  1.4  christos .for _arch in ${DTSGNUARCH}
     10  1.5  christos 	@ln -sf ${S:S@^../@../../@}/external/gpl2/dts/dist/arch/${_arch}/boot/dts dts/${_arch}
     11  1.4  christos .endfor
     12  1.4  christos 
     13  1.1  christos DTSINC?=$S/external/gpl2/dts/dist/include
     14  1.3  jmcneill .for _arch in ${DTSARCH}
     15  1.3  jmcneill DTSDIR+=$S/arch/${_arch}/dts
     16  1.3  jmcneill .endfor
     17  1.3  jmcneill .for _arch in ${DTSGNUARCH}
     18  1.3  jmcneill DTSDIR+=$S/external/gpl2/dts/dist/arch/${_arch}/boot/dts
     19  1.3  jmcneill .for _dir in ${DTSSUBDIR}
     20  1.3  jmcneill .if exists($S/external/gpl2/dts/dist/arch/${_arch}/boot/dts/${_dir})
     21  1.3  jmcneill DTSDIR+=$S/external/gpl2/dts/dist/arch/${_arch}/boot/dts/${_dir}
     22  1.3  jmcneill .endif
     23  1.3  jmcneill .endfor
     24  1.3  jmcneill .endfor
     25  1.3  jmcneill 
     26  1.4  christos DTSPATH=${DTSINC} ${DTSDIR} dts
     27  1.1  christos 
     28  1.1  christos .SUFFIXES: .dtd .dtb .dts
     29  1.1  christos 
     30  1.1  christos .dts.dtd:
     31  1.3  jmcneill 	(${CPP} -P -xassembler-with-cpp ${DTSPATH:@v@-I ${v}@} \
     32  1.3  jmcneill 	    -include ${.IMPSRC} /dev/null | \
     33  1.3  jmcneill 	${TOOL_DTC} ${DTSPATH:@v@-i ${v}@} -I dts -O dtb \
     34  1.2  christos 	    -p ${DTSPADDING} -b 0 -o /dev/null -d /dev/stdout | \
     35  1.2  christos 	${TOOL_SED} -e 's@/dev/null@${.TARGET:.dtd=.dtb}@' \
     36  1.2  christos 	    -e 's@<stdin>@${.IMPSRC}@' && \
     37  1.3  jmcneill 	${CPP} -P -xassembler-with-cpp ${DTSPATH:@v@-I ${v}@} \
     38  1.3  jmcneill 	    -include ${.IMPSRC} -M /dev/null | \
     39  1.2  christos 	${TOOL_SED} -e 's (a] null.o@${.TARGET:.dtd=.dtb}@' \
     40  1.2  christos 	    -e 's@/dev/null@@') > ${.TARGET}
     41  1.2  christos 
     42  1.1  christos 
     43  1.1  christos .dts.dtb:
     44  1.3  jmcneill 	${CPP} -P -xassembler-with-cpp ${DTSPATH:@v@-I ${v}@} \
     45  1.3  jmcneill 	    -include ${.IMPSRC} /dev/null | \
     46  1.3  jmcneill 	${TOOL_DTC} ${DTSPATH:@v@-i ${v}@} -I dts -O dtb \
     47  1.1  christos 	    -p ${DTSPADDING} -b 0 -o ${.TARGET}
     48  1.1  christos 
     49  1.3  jmcneill .PATH.dts: ${DTSDIR}
     50  1.1  christos 
     51  1.1  christos DEPS+= ${DTS:.dts=.dtd}
     52  1.1  christos DTB= ${DTS:.dts=.dtb}
     53  1.1  christos 
     54  1.1  christos all: ${DTB}
     55