config: parallel-safe param.h makefile rule
authorMichael Meffie <mmeffie@sinenomine.net>
Fri, 22 Nov 2013 17:23:17 +0000 (12:23 -0500)
committerDerrick Brashear <shadow@your-file-system.com>
Wed, 29 Jan 2014 15:21:19 +0000 (07:21 -0800)
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.

Change-Id: I823b6a55f3168e991b64660bfe51303d43f693a9
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>

src/config/Makefile.in

index 7775cdf..aefc919 100644 (file)
@@ -60,16 +60,16 @@ config.o: 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)