Ruslan Ermilov <[EMAIL PROTECTED]> writes: > "Dag-Erling Smørgrav" <[EMAIL PROTECTED]> writes: > > BTW, if you just need to ensure that a file exists, a safe alternative > > to 'touch ${FILE}' is ':>>${FILE}'. Makefiles in src/sys/modules > > which use touch should probably be updated to use this instead. > Very good, I like it.
See attached patch. I ended up using :> instead of :>> since that is what is meant in most cases (i.e. the file is supposed to be empty) DES -- Dag-Erling Smørgrav - [EMAIL PROTECTED]
Index: sys/conf/kern.post.mk =================================================================== RCS file: /home/ncvs/src/sys/conf/kern.post.mk,v retrieving revision 1.95 diff -u -r1.95 kern.post.mk --- sys/conf/kern.post.mk 18 Jun 2006 17:48:45 -0000 1.95 +++ sys/conf/kern.post.mk 14 Aug 2006 12:50:05 -0000 @@ -132,7 +132,7 @@ # in the a.out ld. For now, this works. HACK_EXTRA_FLAGS?= -shared hack.So: Makefile - touch hack.c + :> hack.c ${CC} ${HACK_EXTRA_FLAGS} -nostdlib hack.c -o hack.So rm -f hack.c Index: sys/conf/kmod.mk =================================================================== RCS file: /home/ncvs/src/sys/conf/kmod.mk,v retrieving revision 1.209 diff -u -r1.209 kmod.mk --- sys/conf/kmod.mk 30 Jun 2006 19:35:35 -0000 1.209 +++ sys/conf/kmod.mk 14 Aug 2006 12:51:14 -0000 @@ -192,7 +192,7 @@ .if defined(EXPORT_SYMS) .if ${EXPORT_SYMS} != YES .if ${EXPORT_SYMS} == NO - touch export_syms + :> export_syms .elif !exists(${.CURDIR}/${EXPORT_SYMS}) echo ${EXPORT_SYMS} > export_syms .else @@ -311,7 +311,7 @@ CLEANFILES+= ${_src} .if !target(${_src}) ${_src}: - touch ${.TARGET} + :> ${.TARGET} .endif .endfor .endif Index: sys/conf/newvers.sh =================================================================== RCS file: /home/ncvs/src/sys/conf/newvers.sh,v retrieving revision 1.72 diff -u -r1.72 newvers.sh --- sys/conf/newvers.sh 19 Aug 2005 03:56:45 -0000 1.72 +++ sys/conf/newvers.sh 14 Aug 2006 12:50:47 -0000 @@ -83,7 +83,7 @@ echo 0 > version fi -touch version +:>> version v=`cat version` u=${USER:-root} d=`pwd` h=${HOSTNAME:-`hostname`} t=`date` i=`${MAKE:-make} -V KERN_IDENT` cat << EOF > vers.c Index: sys/modules/if_ef/Makefile =================================================================== RCS file: /home/ncvs/src/sys/modules/if_ef/Makefile,v retrieving revision 1.13 diff -u -r1.13 Makefile --- sys/modules/if_ef/Makefile 24 Feb 2006 12:27:09 -0000 1.13 +++ sys/modules/if_ef/Makefile 14 Aug 2006 12:47:29 -0000 @@ -19,16 +19,16 @@ #ETHER_SNAP= opt_inet.h: - echo "#define INET 1" > opt_inet.h + echo "#define INET 1" > ${.TARGET} opt_ipx.h: - echo "#define IPX 1" > opt_ipx.h + echo "#define IPX 1" > ${.TARGET} opt_ef.h: - touch opt_ef.h + :> ${.TARGET} .for frame in ETHER_II ETHER_8023 ETHER_8022 ETHER_SNAP .if defined(${frame}) - echo "#define ${frame} 1" >> opt_ef.h + echo "#define ${frame} 1" >> ${.TARGET} .endif .endfor .endif Index: sys/modules/if_ppp/Makefile =================================================================== RCS file: /home/ncvs/src/sys/modules/if_ppp/Makefile,v retrieving revision 1.35 diff -u -r1.35 Makefile --- sys/modules/if_ppp/Makefile 27 Feb 2006 16:56:22 -0000 1.35 +++ sys/modules/if_ppp/Makefile 14 Aug 2006 12:48:11 -0000 @@ -20,18 +20,20 @@ .endif .if !defined(KERNBUILDDIR) -.if ${PPP_INET} > 0 opt_inet.h: + :> ${.TARGET} +.if ${PPP_INET} > 0 echo "#define INET 1" >> ${.TARGET} .endif -.if ${PPP_IPX} > 0 opt_ipx.h: + :> ${.TARGET} +.if ${PPP_IPX} > 0 echo "#define IPX ${PPP_IPX}" >> ${.TARGET} .endif opt_ppp.h: - touch ${.TARGET} + :> ${.TARGET} .if ${PPP_BSDCOMP} > 0 echo "#define PPP_BSDCOMP ${PPP_BSDCOMP}" >> ${.TARGET} .endif Index: sys/modules/netgraph/mppc/Makefile =================================================================== RCS file: /home/ncvs/src/sys/modules/netgraph/mppc/Makefile,v retrieving revision 1.13 diff -u -r1.13 Makefile --- sys/modules/netgraph/mppc/Makefile 14 Oct 2005 23:30:13 -0000 1.13 +++ sys/modules/netgraph/mppc/Makefile 14 Aug 2006 12:48:18 -0000 @@ -20,7 +20,7 @@ .if !defined(KERNBUILDDIR) opt_netgraph.h: - touch ${.TARGET} + :> ${.TARGET} .if ${NETGRAPH_MPPC_COMPRESSION} > 0 echo "#define NETGRAPH_MPPC_COMPRESSION 1" >> ${.TARGET} .endif Index: sys/modules/sound/sound/Makefile =================================================================== RCS file: /home/ncvs/src/sys/modules/sound/sound/Makefile,v retrieving revision 1.18 diff -u -r1.18 Makefile --- sys/modules/sound/sound/Makefile 27 May 2006 16:32:05 -0000 1.18 +++ sys/modules/sound/sound/Makefile 14 Aug 2006 12:48:58 -0000 @@ -22,7 +22,7 @@ # existing one from KERNBUILDDIR which possibly has DEV_ISA defined so # sound.ko is always built without isadma support. opt_isa.h: - touch ${.TARGET} + :> ${.TARGET} .else SRCS+= sndbuf_dma.c
_______________________________________________ cvs-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/cvs-all To unsubscribe, send any mail to "[EMAIL PROTECTED]"