diff options
author | will <will@FreeBSD.org> | 2015-01-16 21:39:08 +0000 |
---|---|---|
committer | will <will@FreeBSD.org> | 2015-01-16 21:39:08 +0000 |
commit | afad9375d853b7b34e4256d1c3421d937b565c57 (patch) | |
tree | 8a1af53c5feb7376262fc346729ffddd1a4b3c93 | |
parent | 96da0c1c63a35ba3aca3a9ef55e32fde9bdf7964 (diff) | |
download | FreeBSD-src-afad9375d853b7b34e4256d1c3421d937b565c57.zip FreeBSD-src-afad9375d853b7b34e4256d1c3421d937b565c57.tar.gz |
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
-rw-r--r-- | bin/csh/Makefile | 2 | ||||
-rw-r--r-- | etc/mail/Makefile | 4 | ||||
-rw-r--r-- | gnu/usr.bin/grep/Makefile | 2 | ||||
-rw-r--r-- | kerberos5/lib/libasn1/Makefile | 4 | ||||
-rw-r--r-- | kerberos5/lib/libgssapi_spnego/Makefile | 4 | ||||
-rw-r--r-- | kerberos5/lib/libhdb/Makefile | 4 | ||||
-rw-r--r-- | kerberos5/lib/libhx509/Makefile | 4 | ||||
-rw-r--r-- | lib/libc/Makefile | 4 | ||||
-rw-r--r-- | lib/libexpat/Makefile | 2 | ||||
-rw-r--r-- | lib/libunbound/Makefile | 2 | ||||
-rw-r--r-- | secure/lib/libcrypto/Makefile | 2 | ||||
-rw-r--r-- | share/mk/sys.mk | 5 | ||||
-rw-r--r-- | tools/regression/execve/Makefile | 2 | ||||
-rw-r--r-- | tools/test/dtrace/Makefile | 2 | ||||
-rw-r--r-- | usr.bin/grep/Makefile | 2 | ||||
-rw-r--r-- | usr.bin/lex/Makefile | 2 | ||||
-rw-r--r-- | usr.bin/make/Makefile | 2 | ||||
-rw-r--r-- | usr.sbin/mtree/Makefile | 2 |
18 files changed, 28 insertions, 23 deletions
diff --git a/bin/csh/Makefile b/bin/csh/Makefile index e3df1d4..51ef3dd 100644 --- a/bin/csh/Makefile +++ b/bin/csh/Makefile @@ -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 diff --git a/etc/mail/Makefile b/etc/mail/Makefile index 510b024..f8e5b77 100644 --- a/etc/mail/Makefile +++ b/etc/mail/Makefile @@ -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 diff --git a/gnu/usr.bin/grep/Makefile b/gnu/usr.bin/grep/Makefile index ebdb327..93c7324 100644 --- a/gnu/usr.bin/grep/Makefile +++ b/gnu/usr.bin/grep/Makefile @@ -43,7 +43,7 @@ MLINKS+=grep.1 zgrep.1 grep.1 zegrep.1 grep.1 zfgrep.1 .endif gnugrep.1: grep.1 - cp ${.ALLSRC} ${.TARGET} + ${CP} ${.ALLSRC} ${.TARGET} check: all @failed=0; total=0; \ diff --git a/kerberos5/lib/libasn1/Makefile b/kerberos5/lib/libasn1/Makefile index d445b8b..3d65eee 100644 --- a/kerberos5/lib/libasn1/Makefile +++ b/kerberos5/lib/libasn1/Makefile @@ -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> diff --git a/kerberos5/lib/libgssapi_spnego/Makefile b/kerberos5/lib/libgssapi_spnego/Makefile index 9216808..5e54e95 100644 --- a/kerberos5/lib/libgssapi_spnego/Makefile +++ b/kerberos5/lib/libgssapi_spnego/Makefile @@ -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> diff --git a/kerberos5/lib/libhdb/Makefile b/kerberos5/lib/libhdb/Makefile index 1f99fc4..2b178b2 100644 --- a/kerberos5/lib/libhdb/Makefile +++ b/kerberos5/lib/libhdb/Makefile @@ -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> diff --git a/kerberos5/lib/libhx509/Makefile b/kerberos5/lib/libhx509/Makefile index 66e456d..29c45e2 100644 --- a/kerberos5/lib/libhx509/Makefile +++ b/kerberos5/lib/libhx509/Makefile @@ -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> diff --git a/lib/libc/Makefile b/lib/libc/Makefile index 906ace1..eed9070 100644 --- a/lib/libc/Makefile +++ b/lib/libc/Makefile @@ -149,11 +149,11 @@ KSRCS= bcmp.c ffs.c ffsl.c fls.c flsl.c mcount.c strcat.c strchr.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" diff --git a/lib/libexpat/Makefile b/lib/libexpat/Makefile index 523a74e..0d4bef5 100644 --- a/lib/libexpat/Makefile +++ b/lib/libexpat/Makefile @@ -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> diff --git a/lib/libunbound/Makefile b/lib/libunbound/Makefile index 74e5f25..fb593f2 100644 --- a/lib/libunbound/Makefile +++ b/lib/libunbound/Makefile @@ -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 diff --git a/secure/lib/libcrypto/Makefile b/secure/lib/libcrypto/Makefile index c28c510..fb4c4a8 100644 --- a/secure/lib/libcrypto/Makefile +++ b/secure/lib/libcrypto/Makefile @@ -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: diff --git a/share/mk/sys.mk b/share/mk/sys.mk index f691820..0fca510 100644 --- a/share/mk/sys.mk +++ b/share/mk/sys.mk @@ -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 diff --git a/tools/regression/execve/Makefile b/tools/regression/execve/Makefile index edb05ef..018678c 100644 --- a/tools/regression/execve/Makefile +++ b/tools/regression/execve/Makefile @@ -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 diff --git a/tools/test/dtrace/Makefile b/tools/test/dtrace/Makefile index 405d536..ca0547a 100644 --- a/tools/test/dtrace/Makefile +++ b/tools/test/dtrace/Makefile @@ -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 diff --git a/usr.bin/grep/Makefile b/usr.bin/grep/Makefile index 7dfde14..fd27687 100644 --- a/usr.bin/grep/Makefile +++ b/usr.bin/grep/Makefile @@ -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 diff --git a/usr.bin/lex/Makefile b/usr.bin/lex/Makefile index f896092..faa503a 100644 --- a/usr.bin/lex/Makefile +++ b/usr.bin/lex/Makefile @@ -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 diff --git a/usr.bin/make/Makefile b/usr.bin/make/Makefile index bfdeca0..1d366a5 100644 --- a/usr.bin/make/Makefile +++ b/usr.bin/make/Makefile @@ -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> diff --git a/usr.sbin/mtree/Makefile b/usr.sbin/mtree/Makefile index 4f23a75..6d060e2 100644 --- a/usr.sbin/mtree/Makefile +++ b/usr.sbin/mtree/Makefile @@ -16,6 +16,6 @@ LIBADD= md CLEANFILES+= fmtree.8 fmtree.8: mtree.8 - cp -f ${.ALLSRC} ${.TARGET} + ${CP} ${.ALLSRC} ${.TARGET} .include <bsd.prog.mk> |