From owner-p4-projects@FreeBSD.ORG Wed Mar 17 17:40:41 2010 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 8BB791065675; Wed, 17 Mar 2010 17:40:41 +0000 (UTC) Delivered-To: perforce@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4E3A01065670 for ; Wed, 17 Mar 2010 17:40:41 +0000 (UTC) (envelope-from raj@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [IPv6:2001:4f8:fff6::29]) by mx1.freebsd.org (Postfix) with ESMTP id 22A418FC21 for ; Wed, 17 Mar 2010 17:40:41 +0000 (UTC) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.3/8.14.3) with ESMTP id o2HHefRm060673 for ; Wed, 17 Mar 2010 17:40:41 GMT (envelope-from raj@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.14.3/8.14.3/Submit) id o2HHefCc060671 for perforce@freebsd.org; Wed, 17 Mar 2010 17:40:41 GMT (envelope-from raj@freebsd.org) Date: Wed, 17 Mar 2010 17:40:41 GMT Message-Id: <201003171740.o2HHefCc060671@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to raj@freebsd.org using -f From: Rafal Jaworowski To: Perforce Change Reviews Precedence: bulk Cc: Subject: PERFORCE change 175766 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 17 Mar 2010 17:40:41 -0000 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