From owner-svn-src-head@freebsd.org Sat Sep 16 05:42:29 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 01F9AE01DCD; Sat, 16 Sep 2017 05:42:29 +0000 (UTC) (envelope-from sjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B6BAD697EB; Sat, 16 Sep 2017 05:42:28 +0000 (UTC) (envelope-from sjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v8G5gRt3084557; Sat, 16 Sep 2017 05:42:27 GMT (envelope-from sjg@FreeBSD.org) Received: (from sjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v8G5gROb084552; Sat, 16 Sep 2017 05:42:27 GMT (envelope-from sjg@FreeBSD.org) Message-Id: <201709160542.v8G5gROb084552@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sjg set sender to sjg@FreeBSD.org using -f From: "Simon J. Gerraty" Date: Sat, 16 Sep 2017 05:42:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r323637 - head/share/mk X-SVN-Group: head X-SVN-Commit-Author: sjg X-SVN-Commit-Paths: head/share/mk X-SVN-Commit-Revision: 323637 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 16 Sep 2017 05:42:29 -0000 Author: sjg Date: Sat Sep 16 05:42:27 2017 New Revision: 323637 URL: https://svnweb.freebsd.org/changeset/base/323637 Log: Use OBJS_SRCS_FILTER to control setting OBJS from SRCS Some makefiles do reachover builds. In some cases it is convenient to list subdirs of the distribution in SRCS. It is not very convenient, or always even desirable to have corresponding subdirs in .OBJDIR, so OBJS_SRCS_FILTER allows the makefile to choose. The default value 'R' matches existing practice. But a makefile can set OBJS_SRCS_FILTER= T (the R gets added by bsd.init.mk) to avoid the need for subdirs in .OBJDIR Differential Revision: https://reviews.freebsd.org/D12218 Reviewed by: bdrewery Modified: head/share/mk/bsd.dep.mk head/share/mk/bsd.init.mk head/share/mk/bsd.lib.mk head/share/mk/bsd.prog.mk Modified: head/share/mk/bsd.dep.mk ============================================================================== --- head/share/mk/bsd.dep.mk Sat Sep 16 03:54:20 2017 (r323636) +++ head/share/mk/bsd.dep.mk Sat Sep 16 05:42:27 2017 (r323637) @@ -101,7 +101,7 @@ _SKIP_DEPEND= 1 CLEANFILES?= .for _S in ${SRCS:N*.[dhly]} -OBJS_DEPEND_GUESS.${_S:R}.o+= ${_S} +OBJS_DEPEND_GUESS.${_S:${OBJS_SRCS_FILTER:ts:}}.o+= ${_S} .endfor # Lexical analyzers @@ -180,7 +180,7 @@ DEPEND_MP?= -MP DEPEND_FILTER= C,/,_,g DEPENDSRCS= ${SRCS:M*.[cSC]} ${SRCS:M*.cxx} ${SRCS:M*.cpp} ${SRCS:M*.cc} .if !empty(DEPENDSRCS) -DEPENDOBJS+= ${DEPENDSRCS:R:S,$,.o,} +DEPENDOBJS+= ${DEPENDSRCS:${OBJS_SRCS_FILTER:ts:}:S,$,.o,} .endif DEPENDFILES_OBJS= ${DEPENDOBJS:O:u:${DEPEND_FILTER}:C/^/${DEPENDFILE}./} .if defined(_SKIP_DEPEND) Modified: head/share/mk/bsd.init.mk ============================================================================== --- head/share/mk/bsd.init.mk Sat Sep 16 03:54:20 2017 (r323636) +++ head/share/mk/bsd.init.mk Sat Sep 16 05:42:27 2017 (r323637) @@ -16,6 +16,10 @@ ____: .include .MAIN: all +# This is used in bsd.{dep,lib,prog}.mk as ${OBJS_SRCS_FILTER:ts:} +# Some makefiles may want T as well to avoid nested objdirs. +OBJS_SRCS_FILTER+= R + # Handle INSTALL_AS_USER here to maximize the chance that # it has final authority over fooOWN and fooGRP. .if ${MK_INSTALL_AS_USER} != "no" Modified: head/share/mk/bsd.lib.mk ============================================================================== --- head/share/mk/bsd.lib.mk Sat Sep 16 03:54:20 2017 (r323636) +++ head/share/mk/bsd.lib.mk Sat Sep 16 05:42:27 2017 (r323637) @@ -168,7 +168,7 @@ LDFLAGS+= -Wl,--version-script=${VERSION_MAP} .endif .if defined(LIB) && !empty(LIB) || defined(SHLIB_NAME) -OBJS+= ${SRCS:N*.h:R:S/$/.o/} +OBJS+= ${SRCS:N*.h:${OBJS_SRCS_FILTER:ts:}:S/$/.o/} CLEANFILES+= ${OBJS} ${STATICOBJS} .endif @@ -437,13 +437,13 @@ lint: ${SRCS:M*.c} .if defined(LIB) && !empty(LIB) OBJS_DEPEND_GUESS+= ${SRCS:M*.h} .for _S in ${SRCS:N*.[hly]} -OBJS_DEPEND_GUESS.${_S:R}.po+= ${_S} +OBJS_DEPEND_GUESS.${_S:${OBJS_SRCS_FILTER:ts:}}.po+= ${_S} .endfor .endif .if defined(SHLIB_NAME) || \ defined(INSTALL_PIC_ARCHIVE) && defined(LIB) && !empty(LIB) .for _S in ${SRCS:N*.[hly]} -OBJS_DEPEND_GUESS.${_S:R}.pico+= ${_S} +OBJS_DEPEND_GUESS.${_S:${OBJS_SRCS_FILTER:ts:}}.pico+= ${_S} .endfor .endif Modified: head/share/mk/bsd.prog.mk ============================================================================== --- head/share/mk/bsd.prog.mk Sat Sep 16 03:54:20 2017 (r323636) +++ head/share/mk/bsd.prog.mk Sat Sep 16 05:42:27 2017 (r323637) @@ -85,7 +85,7 @@ PROGNAME?= ${PROG} .if defined(SRCS) -OBJS+= ${SRCS:N*.h:R:S/$/.o/g} +OBJS+= ${SRCS:N*.h:${OBJS_SRCS_FILTER:ts:}:S/$/.o/g} .if target(beforelinking) beforelinking: ${OBJS}