Fix installing from read-only ${.OBJDIR}
authorYONETANI Tomokazu <y0netan1@dragonflybsd.org>
Thu, 27 Aug 2009 08:06:34 +0000 (17:06 +0900)
committerYONETANI Tomokazu <y0netan1@dragonflybsd.org>
Sat, 29 Aug 2009 05:52:18 +0000 (14:52 +0900)
creating a file in beforeinstall target requires write permission
in ${.OBJDIR} on machines to run installworld, making it impossible
if mounted read-only via NFS.

libexec/customcc/Makefile

index 1627f9b..ff2094a 100644 (file)
@@ -1,4 +1,4 @@
-SCRIPTS=       cc
+SCRIPTS=       ${.OBJDIR}/cc
 SCRIPTSDIR=    /usr/libexec/custom
 SYMLINKS=      cc ${SCRIPTSDIR}/cpp \
                cc ${SCRIPTSDIR}/c++ \
@@ -7,7 +7,7 @@ SYMLINKS=       cc ${SCRIPTSDIR}/cpp \
 CLEANFILES=    cc
 NOMAN=
 
-beforeinstall:
-       sed "s#@@PREFIX2@@#${USRDATA_PREFIX}/usr#g" ${.CURDIR}/cc.sh >cc
+${.OBJDIR}/cc: cc.sh
+       sed "s#@@PREFIX2@@#${USRDATA_PREFIX}/usr#g" $> > $@
 
 .include <bsd.prog.mk>