2018-12-17 07:37:15 +03:00
|
|
|
# $NetBSD: dts.mk,v 1.10 2018/12/17 04:37:15 thorpej Exp $
|
2017-07-15 18:20:52 +03:00
|
|
|
|
2017-09-08 00:22:19 +03:00
|
|
|
DTSARCH?=${MACHINE_CPU}
|
|
|
|
DTSGNUARCH?=${DTSARCH}
|
2017-07-15 18:20:52 +03:00
|
|
|
DTSPADDING?=1024
|
|
|
|
|
2017-12-05 05:57:37 +03:00
|
|
|
.if !make(obj) && !make(clean) && !make(cleandir)
|
2017-12-10 17:29:47 +03:00
|
|
|
.BEGIN::
|
2017-12-06 05:08:03 +03:00
|
|
|
-@mkdir -p dts
|
2017-12-03 19:36:05 +03:00
|
|
|
.for _arch in ${DTSGNUARCH}
|
2017-12-06 05:08:03 +03:00
|
|
|
-@ln -sf ${S:S@^../@../../@}/external/gpl2/dts/dist/arch/${_arch}/boot/dts dts/${_arch}
|
2017-12-03 19:36:05 +03:00
|
|
|
.endfor
|
2017-12-05 05:57:37 +03:00
|
|
|
.endif
|
2017-12-03 19:36:05 +03:00
|
|
|
|
2017-09-08 00:22:19 +03:00
|
|
|
DTSINC?=$S/external/gpl2/dts/dist/include
|
|
|
|
.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
|
|
|
|
|
2018-12-17 07:37:15 +03:00
|
|
|
DTSPATH=${DTSINC} ${DTSDIR} ${DTS_OVERLAYDIR} dts
|
2017-09-08 00:22:19 +03:00
|
|
|
|
2018-12-17 07:37:15 +03:00
|
|
|
.SUFFIXES: .dtd .dtdo .dtb .dtbo .dts
|
2017-07-15 18:20:52 +03:00
|
|
|
|
|
|
|
.dts.dtd:
|
2017-09-08 00:22:19 +03:00
|
|
|
(${CPP} -P -xassembler-with-cpp ${DTSPATH:@v@-I ${v}@} \
|
|
|
|
-include ${.IMPSRC} /dev/null | \
|
|
|
|
${TOOL_DTC} ${DTSPATH:@v@-i ${v}@} -I dts -O dtb \
|
2018-05-25 22:48:12 +03:00
|
|
|
-p ${DTSPADDING} -b 0 -@ -o /dev/null -d /dev/stdout | \
|
2017-07-15 18:53:48 +03:00
|
|
|
${TOOL_SED} -e 's@/dev/null@${.TARGET:.dtd=.dtb}@' \
|
|
|
|
-e 's@<stdin>@${.IMPSRC}@' && \
|
2017-09-08 00:22:19 +03:00
|
|
|
${CPP} -P -xassembler-with-cpp ${DTSPATH:@v@-I ${v}@} \
|
|
|
|
-include ${.IMPSRC} -M /dev/null | \
|
2017-07-15 18:53:48 +03:00
|
|
|
${TOOL_SED} -e 's@null.o@${.TARGET:.dtd=.dtb}@' \
|
|
|
|
-e 's@/dev/null@@') > ${.TARGET}
|
|
|
|
|
2018-12-17 07:37:15 +03:00
|
|
|
.dts.dtdo:
|
|
|
|
(${CPP} -P -xassembler-with-cpp ${DTSPATH:@v@-I ${v}@} \
|
|
|
|
-include ${.IMPSRC} /dev/null | \
|
|
|
|
${TOOL_DTC} ${DTSPATH:@v@-i ${v}@} -I dts -O dtb \
|
|
|
|
-@ -o /dev/null -d /dev/stdout | \
|
|
|
|
${TOOL_SED} -e 's@/dev/null@${.TARGET:.dtdo=.dtbo}@' \
|
|
|
|
-e 's@<stdin>@${.IMPSRC}@' && \
|
|
|
|
${CPP} -P -xassembler-with-cpp ${DTSPATH:@v@-I ${v}@} \
|
|
|
|
-include ${.IMPSRC} -M /dev/null | \
|
|
|
|
${TOOL_SED} -e 's@null.o@${.TARGET:.dtdo=.dtbo}@' \
|
|
|
|
-e 's@/dev/null@@') > ${.TARGET}
|
2017-07-15 18:20:52 +03:00
|
|
|
|
|
|
|
.dts.dtb:
|
2017-09-08 00:22:19 +03:00
|
|
|
${CPP} -P -xassembler-with-cpp ${DTSPATH:@v@-I ${v}@} \
|
|
|
|
-include ${.IMPSRC} /dev/null | \
|
|
|
|
${TOOL_DTC} ${DTSPATH:@v@-i ${v}@} -I dts -O dtb \
|
2018-05-25 22:48:12 +03:00
|
|
|
-p ${DTSPADDING} -b 0 -@ -o ${.TARGET}
|
2017-07-15 18:20:52 +03:00
|
|
|
|
2018-12-17 07:37:15 +03:00
|
|
|
.dts.dtbo:
|
|
|
|
${CPP} -P -xassembler-with-cpp ${DTSPATH:@v@-I ${v}@} \
|
|
|
|
-include ${.IMPSRC} /dev/null | \
|
|
|
|
${TOOL_DTC} ${DTSPATH:@v@-i ${v}@} -I dts -O dtb \
|
|
|
|
-@ -o ${.TARGET}
|
|
|
|
|
|
|
|
.PATH.dts: ${DTSDIR} ${DTS_OVERLAYDIR}
|
2017-07-15 18:20:52 +03:00
|
|
|
|
|
|
|
DEPS+= ${DTS:.dts=.dtd}
|
2018-12-17 07:37:15 +03:00
|
|
|
DEPS+= ${DTS_OVERLAYS:.dts=.dtdo}
|
|
|
|
DTB= ${DTS:.dts=.dtb}
|
|
|
|
DTBO= ${DTS_OVERLAYS:.dts=.dtbo}
|
2017-07-15 18:20:52 +03:00
|
|
|
|
2018-12-17 07:37:15 +03:00
|
|
|
all: ${DTB} ${DTBO}
|