]> git.michaelhowe.org Git - packages/o/openafs.git/commitdiff
config: parallel-safe param.h makefile rule
authorMichael Meffie <mmeffie@sinenomine.net>
Fri, 22 Nov 2013 17:23:17 +0000 (12:23 -0500)
committerStephan Wiesand <stephan.wiesand@desy.de>
Thu, 7 Aug 2014 10:57:17 +0000 (06:57 -0400)
Generate the param.h.new temporary file in a parallel-safe
way.  The rule to generate the three copies of param.h can
run at the the same time under a parallel make, clobbering
the param.h.new temporary file. Instead of creating this file
inline, create a common rule to generate the temporary file
once.

Reviewed-on: http://gerrit.openafs.org/10516
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
(cherry picked from commit c8e83f0e826bc0a56321408b1c7a2afa137bab05)

Change-Id: I8a85c0e288f2231a3bf693319a8f5fcd618464e8
Reviewed-on: http://gerrit.openafs.org/11229
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Chas Williams - CONTRACTOR <chas@cmf.nrl.navy.mil>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>
src/config/Makefile.in

index 8793663fe5bbdb1ca37f9052f1b91a93c6207753..90b20f19cbad515a893e7041234c185d5868ebbd 100644 (file)
@@ -67,16 +67,16 @@ config.o: ${srcdir}/config.c AFS_component_version_number.c
 # Include installation targets
 #
 
-# XXX inlined INST
-${DEST}/include/afs/param.h ${DESTDIR}${includedir}/afs/param.h ${TOP_INCDIR}/afs/param.h: ${srcdir}/param.${SYS_NAME}.h ${AFS_PARAM_COMMON}
+param.h.new: ${srcdir}/param.${SYS_NAME}.h ${AFS_PARAM_COMMON}
        if [ "X${AFS_PARAM_COMMON}" != "X" ] ; then \
                cat ${srcdir}/${AFS_PARAM_COMMON} ${srcdir}/param.${SYS_NAME}.h > param.h.new ; \
-               $(RM) -f $@; \
-                $(CP) param.h.new $@ ; \
        else \
-               $(RM) -f $@; $(CP) ${srcdir}/param.${SYS_NAME}.h $@ ; \
+               cat ${srcdir}/param.${SYS_NAME}.h > param.h.new ; \
        fi
 
+${DEST}/include/afs/param.h ${DESTDIR}${includedir}/afs/param.h ${TOP_INCDIR}/afs/param.h: param.h.new
+       $(INST)
+
 ${DEST}/include/afs/afs_sysnames.h ${DESTDIR}${includedir}/afs/afs_sysnames.h ${TOP_INCDIR}/afs/afs_sysnames.h: ${srcdir}/afs_sysnames.h
        $(INST)