svn commit: r311158 - stable/11/share/mk
Bryan Drewery
bdrewery at FreeBSD.org
Tue Jan 3 17:16:14 UTC 2017
Author: bdrewery
Date: Tue Jan 3 17:16:13 2017
New Revision: 311158
URL: https://svnweb.freebsd.org/changeset/base/311158
Log:
MFC r305095:
AUTO_OBJ: Support SRCS/DPSRCS that contain '/' and require a nested OBJDIR.
Modified:
stable/11/share/mk/bsd.obj.mk
Directory Properties:
stable/11/ (props changed)
Modified: stable/11/share/mk/bsd.obj.mk
==============================================================================
--- stable/11/share/mk/bsd.obj.mk Tue Jan 3 16:46:51 2017 (r311157)
+++ stable/11/share/mk/bsd.obj.mk Tue Jan 3 17:16:13 2017 (r311158)
@@ -51,6 +51,30 @@ CANONICALOBJDIR= ${.OBJDIR}
# but this makefile does not want it!
.OBJDIR: ${.CURDIR}
.endif
+# Handle special case where SRCS is full-pathed and requires
+# nested objdirs. This duplicates some auto.obj.mk logic.
+.if (!empty(SRCS:M*/*) || !empty(DPSRCS:M*/*)) && \
+ (${.TARGETS} == "" || ${.TARGETS:Nclean*:N*clean:Ndestroy*} != "")
+_wantdirs= ${SRCS:M*/*:H} ${DPSRCS:M*/*:H}
+.if !empty(_wantdirs)
+_wantdirs:= ${_wantdirs:O:u}
+_needdirs=
+.for _dir in ${_wantdirs}
+.if !exists(${.OBJDIR}/${_dir}/)
+_needdirs+= ${_dir}
+.endif
+.endfor
+.endif
+.if !empty(_needdirs)
+#_mkneededdirs!= umask ${OBJDIR_UMASK:U002}; ${Mkdirs} ${_needdirs}
+__objdir_made != umask ${OBJDIR_UMASK:U002}; ${Mkdirs}; \
+ for dir in ${_needdirs}; do \
+ dir=${.OBJDIR}/$${dir}; \
+ ${ECHO_TRACE} "[Creating nested objdir $${dir}...]" >&2; \
+ Mkdirs $${dir}; \
+ done
+.endif
+.endif # !empty(SRCS:M*/*) || !empty(DPSRCS:M*/*)
.elif defined(MAKEOBJDIRPREFIX)
CANONICALOBJDIR:=${MAKEOBJDIRPREFIX}${.CURDIR}
.elif defined(MAKEOBJDIR) && ${MAKEOBJDIR:M/*} != ""
More information about the svn-src-stable
mailing list