Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 16 Jan 2015 21:39:09 +0000 (UTC)
From:      Will Andrews <will@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r277273 - in head: bin/csh etc/mail gnu/usr.bin/grep kerberos5/lib/libasn1 kerberos5/lib/libgssapi_spnego kerberos5/lib/libhdb kerberos5/lib/libhx509 lib/libc lib/libexpat lib/libunboun...
Message-ID:  <201501162139.t0GLd9od006562@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: will
Date: Fri Jan 16 21:39:08 2015
New Revision: 277273
URL: https://svnweb.freebsd.org/changeset/base/277273

Log:
  Add a ${CP} alias for copying files in the build.
  
  Some users build FreeBSD as non-root in Perforce workspaces.  By default,
  Perforce sets files read-only unless they're explicitly being edited.
  As a result, the -f argument must be used to cp in order to override the
  read-only flag when copying source files to object directories.  Bare use of
  'cp' should be avoided in the future.
  
  Update all current users of 'cp' in the src tree.
  
  Reviewed by:	emaste
  MFC after:	1 week
  Sponsored by:	Spectra Logic

Modified:
  head/bin/csh/Makefile
  head/etc/mail/Makefile
  head/gnu/usr.bin/grep/Makefile
  head/kerberos5/lib/libasn1/Makefile
  head/kerberos5/lib/libgssapi_spnego/Makefile
  head/kerberos5/lib/libhdb/Makefile
  head/kerberos5/lib/libhx509/Makefile
  head/lib/libc/Makefile
  head/lib/libexpat/Makefile
  head/lib/libunbound/Makefile
  head/secure/lib/libcrypto/Makefile
  head/share/mk/sys.mk
  head/tools/regression/execve/Makefile
  head/tools/test/dtrace/Makefile
  head/usr.bin/grep/Makefile
  head/usr.bin/lex/Makefile
  head/usr.bin/make/Makefile
  head/usr.sbin/mtree/Makefile

Modified: head/bin/csh/Makefile
==============================================================================
--- head/bin/csh/Makefile	Fri Jan 16 21:12:36 2015	(r277272)
+++ head/bin/csh/Makefile	Fri Jan 16 21:39:08 2015	(r277273)
@@ -93,7 +93,7 @@ GENHDRS+= iconv.h
 SRCS+=	iconv_stub.c
 
 iconv.h: ${.CURDIR}/iconv_stub.h
-	cp -f ${.CURDIR}/iconv_stub.h ${.TARGET}
+	${CP} ${.CURDIR}/iconv_stub.h ${.TARGET}
 .endif
 .endif
 

Modified: head/etc/mail/Makefile
==============================================================================
--- head/etc/mail/Makefile	Fri Jan 16 21:12:36 2015	(r277272)
+++ head/etc/mail/Makefile	Fri Jan 16 21:39:08 2015	(r277273)
@@ -69,7 +69,7 @@ SENDMAIL_MC!=           hostname
 SENDMAIL_MC:=           ${SENDMAIL_MC}.mc
 
 ${SENDMAIL_MC}:
-	cp -f freebsd.mc ${SENDMAIL_MC}
+	${CP} freebsd.mc ${SENDMAIL_MC}
 .endif
 
 .ifndef SENDMAIL_SUBMIT_MC
@@ -77,7 +77,7 @@ SENDMAIL_SUBMIT_MC!=	hostname
 SENDMAIL_SUBMIT_MC:=	${SENDMAIL_SUBMIT_MC}.submit.mc
 
 ${SENDMAIL_SUBMIT_MC}:
-	cp -f freebsd.submit.mc ${SENDMAIL_SUBMIT_MC}
+	${CP} freebsd.submit.mc ${SENDMAIL_SUBMIT_MC}
 .endif
 
 INSTALL_CF=		${SENDMAIL_MC:R}.cf

Modified: head/gnu/usr.bin/grep/Makefile
==============================================================================
--- head/gnu/usr.bin/grep/Makefile	Fri Jan 16 21:12:36 2015	(r277272)
+++ head/gnu/usr.bin/grep/Makefile	Fri Jan 16 21:39:08 2015	(r277273)
@@ -43,7 +43,7 @@ MLINKS+=grep.1 zgrep.1 grep.1 zegrep.1 g
 .endif
 
 gnugrep.1: grep.1
-	cp ${.ALLSRC} ${.TARGET}
+	${CP} ${.ALLSRC} ${.TARGET}
 
 check:	all
 	@failed=0; total=0; \

Modified: head/kerberos5/lib/libasn1/Makefile
==============================================================================
--- head/kerberos5/lib/libasn1/Makefile	Fri Jan 16 21:12:36 2015	(r277272)
+++ head/kerberos5/lib/libasn1/Makefile	Fri Jan 16 21:39:08 2015	(r277273)
@@ -111,10 +111,10 @@ ${GEN_KX509}: kx509.asn1
 .SUFFIXES: .h .c .x .hx
 
 .x.c:
-	cp -f ${.IMPSRC} ${.TARGET}
+	${CP} ${.IMPSRC} ${.TARGET}
 
 .hx.h:
-	cp -f ${.IMPSRC} ${.TARGET}
+	${CP} ${.IMPSRC} ${.TARGET}
 	
 .include <bsd.lib.mk>
 

Modified: head/kerberos5/lib/libgssapi_spnego/Makefile
==============================================================================
--- head/kerberos5/lib/libgssapi_spnego/Makefile	Fri Jan 16 21:12:36 2015	(r277272)
+++ head/kerberos5/lib/libgssapi_spnego/Makefile	Fri Jan 16 21:39:08 2015	(r277273)
@@ -45,10 +45,10 @@ ${GEN}: spnego.asn1 spnego.opt
 .SUFFIXES: .h .c .x .hx
 
 .x.c:   
-	cp ${.IMPSRC} ${.TARGET}
+	${CP} ${.IMPSRC} ${.TARGET}
 
 .hx.h:
-	cp ${.IMPSRC} ${.TARGET}
+	${CP} ${.IMPSRC} ${.TARGET}
 
 .include <bsd.lib.mk>
 

Modified: head/kerberos5/lib/libhdb/Makefile
==============================================================================
--- head/kerberos5/lib/libhdb/Makefile	Fri Jan 16 21:12:36 2015	(r277272)
+++ head/kerberos5/lib/libhdb/Makefile	Fri Jan 16 21:39:08 2015	(r277273)
@@ -91,10 +91,10 @@ ${GEN}: hdb.asn1
 .SUFFIXES: .h .c .x .hx
 
 .x.c:   
-	cp ${.IMPSRC} ${.TARGET}
+	${CP} ${.IMPSRC} ${.TARGET}
 
 .hx.h:
-	cp ${.IMPSRC} ${.TARGET}
+	${CP} ${.IMPSRC} ${.TARGET}
 
 .include <bsd.lib.mk>
 

Modified: head/kerberos5/lib/libhx509/Makefile
==============================================================================
--- head/kerberos5/lib/libhx509/Makefile	Fri Jan 16 21:12:36 2015	(r277272)
+++ head/kerberos5/lib/libhx509/Makefile	Fri Jan 16 21:39:08 2015	(r277273)
@@ -285,10 +285,10 @@ ${GEN_CRMF}: crmf.asn1
 .SUFFIXES: .h .c .x .hx
 
 .x.c:   
-	cp ${.IMPSRC} ${.TARGET}
+	${CP} ${.IMPSRC} ${.TARGET}
 
 .hx.h:
-	cp ${.IMPSRC} ${.TARGET}
+	${CP} ${.IMPSRC} ${.TARGET}
 
 .include <bsd.lib.mk>
 

Modified: head/lib/libc/Makefile
==============================================================================
--- head/lib/libc/Makefile	Fri Jan 16 21:12:36 2015	(r277272)
+++ head/lib/libc/Makefile	Fri Jan 16 21:39:08 2015	(r277273)
@@ -149,11 +149,11 @@ KSRCS=	bcmp.c ffs.c ffsl.c fls.c flsl.c 
 libkern: libkern.gen libkern.${LIBC_ARCH}
 
 libkern.gen: ${KQSRCS} ${KSRCS}
-	cp -fp ${LIBC_SRCTOP}/quad/quad.h ${.ALLSRC} ${DESTDIR}/sys/libkern
+	${CP} ${LIBC_SRCTOP}/quad/quad.h ${.ALLSRC} ${DESTDIR}/sys/libkern
 
 libkern.${LIBC_ARCH}:: ${KMSRCS}
 .if defined(KMSRCS) && !empty(KMSRCS)
-	cp -fp ${.ALLSRC} ${DESTDIR}/sys/libkern/${LIBC_ARCH}
+	${CP} ${.ALLSRC} ${DESTDIR}/sys/libkern/${LIBC_ARCH}
 .endif
 
 .if ${MK_SYSCALL_COMPAT} != "no"

Modified: head/lib/libexpat/Makefile
==============================================================================
--- head/lib/libexpat/Makefile	Fri Jan 16 21:12:36 2015	(r277272)
+++ head/lib/libexpat/Makefile	Fri Jan 16 21:39:08 2015	(r277273)
@@ -28,6 +28,6 @@ bsdxml.h: expat.h
 		> ${.TARGET}
 
 bsdxml_external.h: expat_external.h
-	cp -f ${.ALLSRC} ${.TARGET}
+	${CP} ${.ALLSRC} ${.TARGET}
 
 .include <bsd.lib.mk>

Modified: head/lib/libunbound/Makefile
==============================================================================
--- head/lib/libunbound/Makefile	Fri Jan 16 21:12:36 2015	(r277272)
+++ head/lib/libunbound/Makefile	Fri Jan 16 21:39:08 2015	(r277273)
@@ -32,7 +32,7 @@ LIBADD=	ssl crypto pthread
 
 # Misnamed file in upstream source
 configlexer.l: configlexer.lex
-	cp -fp ${.ALLSRC} ${.TARGET}
+	${CP} ${.ALLSRC} ${.TARGET}
 CLEANFILES+= configlexer.l
 
 # Symbol prefix for lex and yacc

Modified: head/secure/lib/libcrypto/Makefile
==============================================================================
--- head/secure/lib/libcrypto/Makefile	Fri Jan 16 21:12:36 2015	(r277272)
+++ head/secure/lib/libcrypto/Makefile	Fri Jan 16 21:39:08 2015	(r277273)
@@ -400,7 +400,7 @@ opensslconf.h: opensslconf-x86.h
 .else
 opensslconf.h: opensslconf-${MACHINE_CPUARCH}.h
 .endif
-	cp -f ${.ALLSRC} ${.TARGET}
+	${CP} ${.ALLSRC} ${.TARGET}
 
 OLDSYMLINKS+=	libdes.a libdes.so libdes.so.3 libdes_p.a
 afterinstall:

Modified: head/share/mk/sys.mk
==============================================================================
--- head/share/mk/sys.mk	Fri Jan 16 21:12:36 2015	(r277272)
+++ head/share/mk/sys.mk	Fri Jan 16 21:39:08 2015	(r277273)
@@ -67,6 +67,11 @@ CTFFLAGS	?=	-L VERSION
 
 CTFCONVERT	?=	ctfconvert
 CTFMERGE	?=	ctfmerge
+
+# cp(1) is used to copy source files to ${.OBJDIR}, make sure it can handle
+# read-only files as non-root by passing -f.
+CP		?=	cp -f
+
 DTRACE		?=	dtrace
 .if defined(CFLAGS) && (${CFLAGS:M-g} != "")
 CTFFLAGS	+=	-g

Modified: head/tools/regression/execve/Makefile
==============================================================================
--- head/tools/regression/execve/Makefile	Fri Jan 16 21:12:36 2015	(r277272)
+++ head/tools/regression/execve/Makefile	Fri Jan 16 21:39:08 2015	(r277273)
@@ -14,7 +14,7 @@ all:		${PROG} goodaout ${TESTSCRIPTS}
 
 .for x in ${TESTSCRIPTS}
 ${x}: ${TD}/${x}
-	cp ${TD}/${x} .
+	${CP} ${TD}/${x} .
 	chmod +x ${x}
 .endfor
 

Modified: head/tools/test/dtrace/Makefile
==============================================================================
--- head/tools/test/dtrace/Makefile	Fri Jan 16 21:12:36 2015	(r277272)
+++ head/tools/test/dtrace/Makefile	Fri Jan 16 21:39:08 2015	(r277273)
@@ -343,7 +343,7 @@ ${_f:T:S/c$/exe/} : ${_f}
 
 .for _f in ${ALL_TESTEXEFILES}
 ${_f:T} : ${_f}
-	cp -f ${_f} ${.TARGET}
+	${CP} ${_f} ${.TARGET}
 	chmod a+x ${.TARGET}
 .endfor
 

Modified: head/usr.bin/grep/Makefile
==============================================================================
--- head/usr.bin/grep/Makefile	Fri Jan 16 21:12:36 2015	(r277272)
+++ head/usr.bin/grep/Makefile	Fri Jan 16 21:39:08 2015	(r277273)
@@ -11,7 +11,7 @@ PROG=	bsdgrep
 CLEANFILES+= bsdgrep.1
 
 bsdgrep.1: grep.1
-	cp -f ${.ALLSRC} ${.TARGET}
+	${CP} ${.ALLSRC} ${.TARGET}
 .endif
 SRCS=	file.c grep.c queue.c util.c
 

Modified: head/usr.bin/lex/Makefile
==============================================================================
--- head/usr.bin/lex/Makefile	Fri Jan 16 21:12:36 2015	(r277272)
+++ head/usr.bin/lex/Makefile	Fri Jan 16 21:39:08 2015	(r277273)
@@ -51,7 +51,7 @@ bootstrap: ${GENFILES:S/^/init/g}
 	@diff -I '^#line ' -I '\$$FreeBS[D]: .*\$$' -q \
 	    ${.CURDIR}/init${_f} ${_f} 2> /dev/null || { \
 		echo "Bootstrapping ${_f}" ; \
-		cp -f ${.CURDIR}/init${_f} ${_f} ; \
+		${CP} ${.CURDIR}/init${_f} ${_f} ; \
 	}
 .endfor
 

Modified: head/usr.bin/make/Makefile
==============================================================================
--- head/usr.bin/make/Makefile	Fri Jan 16 21:12:36 2015	(r277272)
+++ head/usr.bin/make/Makefile	Fri Jan 16 21:39:08 2015	(r277273)
@@ -115,6 +115,6 @@ CFLAGS+=	-DDEFSHELLNAME=\"${MAKE_SHELL}\
 PROG=	fmake
 CLEANFILES+=	fmake.1
 fmake.1: make.1
-	cp ${.ALLSRC} ${.TARGET}
+	${CP} ${.ALLSRC} ${.TARGET}
 
 .include <bsd.prog.mk>

Modified: head/usr.sbin/mtree/Makefile
==============================================================================
--- head/usr.sbin/mtree/Makefile	Fri Jan 16 21:12:36 2015	(r277272)
+++ head/usr.sbin/mtree/Makefile	Fri Jan 16 21:39:08 2015	(r277273)
@@ -16,6 +16,6 @@ LIBADD=	md
 CLEANFILES+=	fmtree.8
 
 fmtree.8: mtree.8
-	cp -f ${.ALLSRC} ${.TARGET}
+	${CP} ${.ALLSRC} ${.TARGET}
 
 .include <bsd.prog.mk>



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201501162139.t0GLd9od006562>