[Midnightbsd-cvs] src [10155] trunk/sys/conf/dtb.mk: add dtb.mk

laffer1 at midnightbsd.org laffer1 at midnightbsd.org
Wed May 30 17:42:07 EDT 2018


Revision: 10155
          http://svnweb.midnightbsd.org/src/?rev=10155
Author:   laffer1
Date:     2018-05-30 17:40:06 -0400 (Wed, 30 May 2018)
Log Message:
-----------
add dtb.mk

Added Paths:
-----------
    trunk/sys/conf/dtb.mk

Added: trunk/sys/conf/dtb.mk
===================================================================
--- trunk/sys/conf/dtb.mk	                        (rev 0)
+++ trunk/sys/conf/dtb.mk	2018-05-30 21:40:06 UTC (rev 10155)
@@ -0,0 +1,79 @@
+# $MidnightBSD$
+# $FreeBSD: stable/10/sys/conf/dtb.mk 284002 2015-06-04 22:11:39Z imp $
+#
+# The include file <dtb.mk> handles building and installing dtb files.
+#
+# +++ variables +++
+#
+# DTS		List of the dts files to build and install.
+#
+# DTBDIR	Base path for dtb modules [/boot/dtb]
+#
+# DTBOWN	.dtb file owner. [${BINOWN}]
+#
+# DTBGRP	.dtb file group. [${BINGRP}]
+#
+# DTBMODE	Module file mode. [${BINMODE}]
+#
+# DESTDIR	The tree where the module gets installed. [not set]
+#
+# +++ targets +++
+#
+# 	install:
+#               install the kernel module; if the Makefile
+#               does not itself define the target install, the targets
+#               beforeinstall and afterinstall may also be used to cause
+#               actions immediately before and after the install target
+#		is executed.
+#
+
+.include <bsd.init.mk>
+# Grab all the options for a kernel build. For backwards compat, we need to
+# do this after bsd.own.mk.
+#.include "kern.opts.mk" # commented out to minize difference with 11.x and newer
+
+# Search for kernel source tree in standard places.
+.for _dir in ${.CURDIR}/../.. ${.CURDIR}/../../.. /sys /usr/src/sys
+.if !defined(SYSDIR) && exists(${_dir}/kern/)
+SYSDIR=	${_dir}
+.endif
+.endfor
+.if !defined(SYSDIR) || !exists(${SYSDIR}/kern/)
+.error "can't find kernel source tree"
+.endif
+
+.SUFFIXES: .dtb .dts
+
+.PATH: ${SYSDIR}/gnu/dts/${MACHINE} ${SYSDIR}/boot/fdt/dts/${MACHINE}
+
+DTB=${DTS:R:S/$/.dtb/}
+
+all: ${DTB}
+
+.if defined(DTS)
+.for _dts in ${DTS}
+${_dts:R:S/$/.dtb/}:	${_dts}
+	@echo Generating ${.TARGET} from ${_dts}
+	@${SYSDIR}/tools/fdt/make_dtb.sh ${SYSDIR} ${_dts} ${.OBJDIR}
+CLEANFILES+=${_dts:R:S/$/.dtb/}
+.endfor
+.endif
+
+.if !target(install)
+.if !target(realinstall)
+realinstall: _dtbinstall
+.ORDER: beforeinstall _kmodinstall
+_dtbinstall:
+# Need to create this because installkernel doesn't invoke mtree with BSD.root.mtree
+# to make sure the tree is setup properly. This may break ownership of ${DTBDIR}
+# for no-root build.
+	mkdir -p ${DESTDIR}${DTBDIR}
+.for _dtb in ${DTB}
+	${INSTALL} -o ${DTBOWN} -g ${DTBGRP} -m ${DTBMODE} \
+	    ${_INSTALLFLAGS} ${_dtb} ${DESTDIR}${DTBDIR}
+.endfor
+.endif # !target(realinstall)
+.endif # !target(install)
+
+.include <bsd.dep.mk>
+.include <bsd.obj.mk>


Property changes on: trunk/sys/conf/dtb.mk
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+MidnightBSD=%H
\ No newline at end of property
Added: svn:mime-type
## -0,0 +1 ##
+text/plain
\ No newline at end of property


More information about the Midnightbsd-cvs mailing list