From c151bfd6807b14f1c125f4b1d205c765a3a73031 Mon Sep 17 00:00:00 2001 From: Ken Raeburn Date: Tue, 24 Sep 2002 17:58:33 +0000 Subject: [PATCH] * pre.in (.et.c, .et.h): Change rules to only update the desired target file, by using temporary files; this makes them safe for use in parallel builds. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@14895 dc483132-0cff-0310-8789-dd5450dbe970 --- src/config/ChangeLog | 6 ++++++ src/config/pre.in | 14 ++++++++++++-- 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/src/config/ChangeLog b/src/config/ChangeLog index 9da9700d8..1ff8bd012 100644 --- a/src/config/ChangeLog +++ b/src/config/ChangeLog @@ -1,3 +1,9 @@ +2002-09-24 Ken Raeburn + + * pre.in (.et.c, .et.h): Change rules to only update the desired + target file, by using temporary files; this makes them safe for + use in parallel builds. + 2002-09-19 Ezra Peisach * post.in (Makefile): Revert change until aclocal.m4 fixed. diff --git a/src/config/pre.in b/src/config/pre.in index e7c751c15..8671396f9 100644 --- a/src/config/pre.in +++ b/src/config/pre.in @@ -317,11 +317,21 @@ COMPILE_ET-k5= $(BUILDTOP)/util/et/compile_et -d $(SRCTOP)/util/et .SUFFIXES: .h .c .et .ct +# These versions cause both .c and .h files to be generated at once. +# But GNU make doesn't understand this, and parallel builds can trigger +# both of them at once, causing them to stomp on each other. The versions +# below only update one of the files, so compile_et has to get run twice, +# but it won't break parallel builds. +#.et.h: ; $(COMPILE_ET) $< +#.et.c: ; $(COMPILE_ET) $< + .et.h: - $(COMPILE_ET) $< + set -x ; d=ettmp$$$$ ; (cp $< $$d.et && $(COMPILE_ET) $$d.et && mv $$d.h $*.h) ; \ + e=$$? ; rm -f $$d.* ; exit $$e .et.c: - $(COMPILE_ET) $< + set -x ; d=ettmp$$$$ ; (cp $< $$d.et && $(COMPILE_ET) $$d.et && mv $$d.c $*.c) ; \ + e=$$? ; rm -f $$d.* ; exit $$e # rule to make object files # -- 2.26.2