diff --git a/Makefile.inc1 b/Makefile.inc1 index 0fd7e240d133..37fde6f8b875 100644 --- a/Makefile.inc1 +++ b/Makefile.inc1 @@ -1389,11 +1389,54 @@ check-old: check-old-files check-old-libs check-old-dirs showconfig: @${MAKE} -n -f bsd.own.mk -V dummy -dg1 | grep ^MK_ | sort +.if !empty(KRNLOBJDIR) && !empty(KERNCONF) +DTBOUTPUTPATH= ${KRNLOBJDIR}/${KERNCONF}/ + +.if !defined(FDT_DTS_FILE) || empty(FDT_DTS_FILE) +.if exists(${KERNCONFDIR}/${KERNCONF}) +FDT_DTS_FILE!= awk 'BEGIN {FS="="} /^makeoptions[[:space:]]+FDT_DTS_FILE/ {print $$2}' \ + ${KERNCONFDIR}/${KERNCONF} +.endif +.endif + +.endif + +.if !defined(DTBOUTPUTPATH) || !exists(${DTBOUTPUTPATH}) +DTBOUTPUTPATH= ${.CURDIR} +.endif + +# +# Build 'standalone' Device Tree Blob +# +builddtb: + @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`.dtb -b 0 \ + -p 1024 ${.CURDIR}/sys/boot/fdt/dts/${FDT_DTS_FILE} ############### .if defined(XDEV) && defined(XDEV_ARCH) +.if ${XDEV} == ${MACHINE} && ${XDEV_ARCH} == ${MACHINE_ARCH} +XDEV_CPUTYPE?=${CPUTYPE} +.else +XDEV_CPUTYPE?=${TARGET_CPUTYPE} +.endif + NOFUN=-DNO_FSCHG -DWITHOUT_HTML -DWITHOUT_INFO -DNO_LINT \ -DWITHOUT_MAN -DWITHOUT_NLS -DWITHOUT_PROFILE \ -DWITHOUT_KERBEROS -DWITHOUT_RESCUE -DNO_WARNS @@ -1401,7 +1444,8 @@ NOFUN=-DNO_FSCHG -DWITHOUT_HTML -DWITHOUT_INFO -DNO_LINT \ XDDIR=${XDEV}-freebsd XDTP=/usr/${XDDIR} CDBENV=MAKEOBJDIRPREFIX=${MAKEOBJDIRPREFIX}/${XDDIR} \ - TARGET=${XDEV} TARGET_ARCH=${XDEV_ARCH} + TARGET=${XDEV} TARGET_ARCH=${XDEV_ARCH} \ + CPUTYPE=${XDEV_CPUTYPE} CDENV= ${CDBENV} \ _SHLIBDIRPREFIX=${XDTP} \ TOOLS_PREFIX=${XDTP} @@ -1477,41 +1521,3 @@ _xi-links: ../../../../usr/bin/${XDDIR}${OSREL}-$$i; \ done .endif - -.if !empty(KRNLOBJDIR) && !empty(KERNCONF) -DTBOUTPUTPATH= ${KRNLOBJDIR}/${KERNCONF}/ - -.if !defined(FDT_DTS_FILE) || empty(FDT_DTS_FILE) -.if exists(${KERNCONFDIR}/${KERNCONF}) -FDT_DTS_FILE!= awk 'BEGIN {FS="="} /^makeoptions[[:space:]]+FDT_DTS_FILE/ {print $$2}' \ - ${KERNCONFDIR}/${KERNCONF} -.endif -.endif - -.endif - -.if !defined(DTBOUTPUTPATH) || !exists(${DTBOUTPUTPATH}) -DTBOUTPUTPATH= ${.CURDIR} -.endif - -# -# Build 'standalone' Device Tree Blob -# -builddtb: - @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`.dtb -b 0 \ - -p 1024 ${.CURDIR}/sys/boot/fdt/dts/${FDT_DTS_FILE}