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