Date: Wed, 17 Mar 2010 17:40:41 GMT From: Rafal Jaworowski <raj@FreeBSD.org> To: Perforce Change Reviews <perforce@freebsd.org> Subject: PERFORCE change 175766 for review Message-ID: <201003171740.o2HHefCc060671@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
http://p4web.freebsd.org/chv.cgi?CH=175766 Change 175766 by raj@raj_fdt on 2010/03/17 17:40:06 Harden DTS compilation infrastructure against various error scenarios. Affected files ... .. //depot/projects/fdt/Makefile.inc1#12 edit .. //depot/projects/fdt/share/mk/bsd.own.mk#5 edit Differences ... ==== //depot/projects/fdt/Makefile.inc1#12 (text+ko) ==== @@ -1443,29 +1443,38 @@ done .endif -.if ${MK_FDT} != "no" +.if !empty(KRNLOBJDIR) && !empty(KERNCONF) +DTBOUTPUTPATH= ${KRNLOBJDIR}/${KERNCONF}/ + +.if !defined(FDT_DTS_FILE) || empty(FDT_DTS_FILE) +FDT_DTS_FILE!= grep "^makeoptions[[:space:]]\+FDT_DTS_FILE" \ + ${KERNCONFDIR}/${KERNCONF} 2> /dev/null | cut -d= -f2 +.endif -.if defined(FDT_DTS_OUTPUT) -DTBOUTPUTPATH= ${FDT_DTS_OUTPUT} -.else -DTBOUTPUTPATH= ${KRNLOBJDIR}/${KERNCONF}/ .endif -.if !defined(FDT_DTS_FILE) || empty(FDT_DTS_FILE) -FDT_DTS_FILE!= grep "makeoptions[[:space:]]\+FDT_DTS_FILE" \ - ${KERNCONFDIR}/${KERNCONF} | cut -d= -f2 +.if !defined(DTBOUTPUTPATH) || !exists(${DTBOUTPUTPATH}) +DTBOUTPUTPATH= ${.CURDIR} .endif # # Build 'standalone' Device Tree Blob # builddtb: -.if !empty(FDT_DTS_FILE) -.if !exists(${.CURDIR}/sys/boot/fdt/dts/${FDT_DTS_FILE}) -.error ${.CURDIR}/sys/boot/fdt/dts/${FDT_DTS_FILE} not found! -.endif + @if [ "${FDT_DTS_FILE}" = "" ]; then \ + echo "ERROR: FDT_DTS_FILE must be specified!"; \ + exit 1; \ + fi; \ + if [ ! -f ${.CURDIR}/sys/boot/fdt/dts/${FDT_DTS_FILE} ]; then \ + echo "ERROR: Specified DTS file (${FDT_DTS_FILE}) does not \ + exist!"; \ + exit 1; \ + fi; \ + if [ "${DTBOUTPUTPATH}" = "${.CURDIR}" ]; then \ + echo "WARNING: DTB will be placed in the current working \ + directory"; \ + fi PATH=${TMPPATH} \ - dtc -O dtb -o ${DTBOUTPUTPATH}/`echo ${FDT_DTS_FILE} | cut -d. -f1` \ - -b 0 -p 1024 ${.CURDIR}/sys/boot/fdt/dts/${FDT_DTS_FILE} -.endif -.endif + dtc -O dtb -o \ + ${DTBOUTPUTPATH}/`echo ${FDT_DTS_FILE} | cut -d. -f1`.dtb -b 0 \ + -p 1024 ${.CURDIR}/sys/boot/fdt/dts/${FDT_DTS_FILE} ==== //depot/projects/fdt/share/mk/bsd.own.mk#5 (text+ko) ==== @@ -279,7 +279,8 @@ .endif # Enable FDT by default for selected platforms. -.if ${TARGET_ARCH} == "arm" || ${TARGET_ARCH} == "powerpc" +.if defined(TARGET_ARCH) && \ + (${TARGET_ARCH} == "arm" || ${TARGET_ARCH} == "powerpc") _fdt= FDT .else _no_fdt= FDT
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201003171740.o2HHefCc060671>