svn commit: r305095 - head/share/mk
Bryan Drewery
bdrewery at FreeBSD.org
Tue Aug 30 22:48:06 UTC 2016
Author: bdrewery
Date: Tue Aug 30 22:48:05 2016
New Revision: 305095
URL: https://svnweb.freebsd.org/changeset/base/305095
Log:
AUTO_OBJ: Support SRCS/DPSRCS that contain '/' and require a nested OBJDIR.
This is to be used by the new clang3.9 build and extends functionality
added to 'make obj' in r279980.
MFC after: 2 weeks
Sponsored by: EMC / Isilon Storage Division
Modified:
head/share/mk/bsd.obj.mk
Modified: head/share/mk/bsd.obj.mk
==============================================================================
--- head/share/mk/bsd.obj.mk Tue Aug 30 22:32:33 2016 (r305094)
+++ head/share/mk/bsd.obj.mk Tue Aug 30 22:48:05 2016 (r305095)
@@ -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-head
mailing list