]> git.ipfire.org Git - thirdparty/gettext.git/commitdiff
Fix moopp rules for parallel make.
authorBruno Haible <bruno@clisp.org>
Thu, 14 Dec 2006 12:30:15 +0000 (12:30 +0000)
committerBruno Haible <bruno@clisp.org>
Tue, 23 Jun 2009 10:14:28 +0000 (12:14 +0200)
12 files changed:
gnulib-local/ChangeLog
gnulib-local/build-aux/moopp
gnulib-local/modules/fd-ostream
gnulib-local/modules/file-ostream
gnulib-local/modules/html-ostream
gnulib-local/modules/html-styled-ostream
gnulib-local/modules/iconv-ostream
gnulib-local/modules/memory-ostream
gnulib-local/modules/ostream
gnulib-local/modules/styled-ostream
gnulib-local/modules/term-ostream
gnulib-local/modules/term-styled-ostream

index 2077113d3a9fcd972b3f2648919e9f9e6f7045f8..ac3b03763dde97b02f6ae7fdd3ce50e9ca636077 100644 (file)
@@ -1,3 +1,20 @@
+2006-12-12  Bruno Haible  <bruno@clisp.org>
+
+       Fix moopp rules for parallel make.
+       * build-aux/moopp: Generate source.h first and source.c last.
+       * modules/ostream (Makefile.am): Rewrite the moopp rule so that all
+       generated files depend on the generated .h file.
+       * modules/fd-ostream (Makefile.am): Likewise.
+       * modules/file-ostream (Makefile.am): Likewise.
+       * modules/html-ostream (Makefile.am): Likewise.
+       * modules/iconv-ostream (Makefile.am): Likewise.
+       * modules/memory-ostream (Makefile.am): Likewise.
+       * modules/term-ostream (Makefile.am): Likewise.
+       * modules/styled-ostream (Makefile.am): Likewise.
+       * modules/html-styled-ostream (Makefile.am): Likewise.
+       * modules/term-styled-ostream (Makefile.am): Likewise.
+       Reported by Ralf Wildenhues.
+
 2006-12-12  Bruno Haible  <bruno@clisp.org>
 
        * build-aux/moopp (func_emit_priv_h, func_emit_vt_h,
index 9673aae6a510da08daf7621d5fa38434c06fb57b..463e8302aa2e40b77b2c30fbd35356788de9536a 100755 (executable)
@@ -610,16 +610,23 @@ func_emit_source_c ()
   } > "$newfile"
 }
 
+# Generate the source.h file first. The Makefile.am snippets rely on the
+# fact that the other generated files have the same or a newer timestamp.
+#
+# Also, generate the source.c file last. The Makefile.am snippets don't know
+# about the other generated files; they assume that when the source.c file
+# is finished, this command is complete.
+
+new_source_header_file=`echo "$source_header_file_base" | sed -e 's,\.oo\.h$,.h,'`
+func_start_creation "$new_source_header_file"
+func_emit_source_h "$new_source_header_file" || func_fatal_error "failed"
+
 func_start_creation "${main_classname}.priv.h"
 func_emit_priv_h "${main_classname}.priv.h" || func_fatal_error "failed"
 
 func_start_creation "${main_classname}.vt.h"
 func_emit_vt_h "${main_classname}.vt.h" || func_fatal_error "failed"
 
-new_source_header_file=`echo "$source_header_file_base" | sed -e 's,\.oo\.h$,.h,'`
-func_start_creation "$new_source_header_file"
-func_emit_source_h "$new_source_header_file" || func_fatal_error "failed"
-
 new_source_impl_file=`echo "$source_impl_file_base" | sed -e 's,\.oo\.c$,.c,'`
 func_start_creation "$new_source_impl_file"
 func_emit_source_c "$new_source_impl_file" || func_fatal_error "failed"
index 1ac8af403bda193367986778439e7a4f0c8891a2..937da5e27566d648a24949b0046fc7456cfec21e 100644 (file)
@@ -17,8 +17,22 @@ configure.ac:
 
 Makefile.am:
 lib_SOURCES += fd-ostream.c
-fd-ostream.h fd-ostream.c : $(top_srcdir)/build-aux/moopp fd-ostream.oo.h fd-ostream.oo.c ostream.oo.h
+# This is a Makefile rule that generates multiple files at once; see the
+# automake documentation, node "Multiple Outputs", for details.
+fd-ostream.h : $(top_srcdir)/build-aux/moopp fd-ostream.oo.h fd-ostream.oo.c ostream.oo.h
        $(top_srcdir)/build-aux/moopp $(srcdir)/fd-ostream.oo.c $(srcdir)/fd-ostream.oo.h $(srcdir)/ostream.oo.h
+fd-ostream.c : fd-ostream.h
+       @test -f $@ || { \
+         trap 'rm -rf fd-ostream.lock' 1 2 13 15; \
+         if mkdir fd-ostream.lock 2>/dev/null; then \
+           echo "$(top_srcdir)/build-aux/moopp $(srcdir)/fd-ostream.oo.c $(srcdir)/fd-ostream.oo.h $(srcdir)/ostream.oo.h"; \
+           $(top_srcdir)/build-aux/moopp $(srcdir)/fd-ostream.oo.c $(srcdir)/fd-ostream.oo.h $(srcdir)/ostream.oo.h; \
+           result=$$?; rm -rf fd-ostream.lock; exit $$result; \
+         else \
+           while test -d fd-ostream.lock; do sleep 1; done; \
+           test -f fd-ostream.h; \
+         fi; \
+       }
 BUILT_SOURCES += fd-ostream.h fd-ostream.c fd_ostream.priv.h fd_ostream.vt.h
 CLEANFILES += fd-ostream.h fd-ostream.c fd_ostream.priv.h fd_ostream.vt.h
 
index e943b61a8d26f379c4814e5346eacd37b3ec332b..9f4906e296aba0bb67bcc089fec90c752241e474 100644 (file)
@@ -13,8 +13,22 @@ configure.ac:
 
 Makefile.am:
 lib_SOURCES += file-ostream.c
-file-ostream.h file-ostream.c : $(top_srcdir)/build-aux/moopp file-ostream.oo.h file-ostream.oo.c ostream.oo.h
+# This is a Makefile rule that generates multiple files at once; see the
+# automake documentation, node "Multiple Outputs", for details.
+file-ostream.h : $(top_srcdir)/build-aux/moopp file-ostream.oo.h file-ostream.oo.c ostream.oo.h
        $(top_srcdir)/build-aux/moopp $(srcdir)/file-ostream.oo.c $(srcdir)/file-ostream.oo.h $(srcdir)/ostream.oo.h
+file-ostream.c : file-ostream.h
+       @test -f $@ || { \
+         trap 'rm -rf file-ostream.lock' 1 2 13 15; \
+         if mkdir file-ostream.lock 2>/dev/null; then \
+           echo "$(top_srcdir)/build-aux/moopp $(srcdir)/file-ostream.oo.c $(srcdir)/file-ostream.oo.h $(srcdir)/ostream.oo.h"; \
+           $(top_srcdir)/build-aux/moopp $(srcdir)/file-ostream.oo.c $(srcdir)/file-ostream.oo.h $(srcdir)/ostream.oo.h; \
+           result=$$?; rm -rf file-ostream.lock; exit $$result; \
+         else \
+           while test -d file-ostream.lock; do sleep 1; done; \
+           test -f file-ostream.h; \
+         fi; \
+       }
 BUILT_SOURCES += file-ostream.h file-ostream.c file_ostream.priv.h file_ostream.vt.h
 CLEANFILES += file-ostream.h file-ostream.c file_ostream.priv.h file_ostream.vt.h
 
index 29a3acd7e0197f10d174e91d6addf8d341d5b3a5..67003d64e4321e4f022f5d113f8f22c4ebe03c2f 100644 (file)
@@ -16,8 +16,22 @@ configure.ac:
 
 Makefile.am:
 lib_SOURCES += html-ostream.c
-html-ostream.h html-ostream.c : $(top_srcdir)/build-aux/moopp html-ostream.oo.h html-ostream.oo.c ostream.oo.h
+# This is a Makefile rule that generates multiple files at once; see the
+# automake documentation, node "Multiple Outputs", for details.
+html-ostream.h : $(top_srcdir)/build-aux/moopp html-ostream.oo.h html-ostream.oo.c ostream.oo.h
        $(top_srcdir)/build-aux/moopp $(srcdir)/html-ostream.oo.c $(srcdir)/html-ostream.oo.h $(srcdir)/ostream.oo.h
+html-ostream.c : html-ostream.h
+       @test -f $@ || { \
+         trap 'rm -rf html-ostream.lock' 1 2 13 15; \
+         if mkdir html-ostream.lock 2>/dev/null; then \
+           echo "$(top_srcdir)/build-aux/moopp $(srcdir)/html-ostream.oo.c $(srcdir)/html-ostream.oo.h $(srcdir)/ostream.oo.h"; \
+           $(top_srcdir)/build-aux/moopp $(srcdir)/html-ostream.oo.c $(srcdir)/html-ostream.oo.h $(srcdir)/ostream.oo.h; \
+           result=$$?; rm -rf html-ostream.lock; exit $$result; \
+         else \
+           while test -d html-ostream.lock; do sleep 1; done; \
+           test -f html-ostream.h; \
+         fi; \
+       }
 BUILT_SOURCES += html-ostream.h html-ostream.c html_ostream.priv.h html_ostream.vt.h
 CLEANFILES += html-ostream.h html-ostream.c html_ostream.priv.h html_ostream.vt.h
 
index 9ac89ba3a42d1c32f2b567bb9c3257ec5a6fe90a..e8fb5b9686787dcc2ac8dfa59329661617abf56c 100644 (file)
@@ -20,8 +20,22 @@ configure.ac:
 
 Makefile.am:
 lib_SOURCES += html-styled-ostream.c
-html-styled-ostream.h html-styled-ostream.c : $(top_srcdir)/build-aux/moopp html-styled-ostream.oo.h html-styled-ostream.oo.c styled-ostream.oo.h ostream.oo.h
+# This is a Makefile rule that generates multiple files at once; see the
+# automake documentation, node "Multiple Outputs", for details.
+html-styled-ostream.h : $(top_srcdir)/build-aux/moopp html-styled-ostream.oo.h html-styled-ostream.oo.c styled-ostream.oo.h ostream.oo.h
        $(top_srcdir)/build-aux/moopp $(srcdir)/html-styled-ostream.oo.c $(srcdir)/html-styled-ostream.oo.h $(srcdir)/styled-ostream.oo.h $(srcdir)/ostream.oo.h
+html-styled-ostream.c : html-styled-ostream.h
+       @test -f $@ || { \
+         trap 'rm -rf html-styled-ostream.lock' 1 2 13 15; \
+         if mkdir html-styled-ostream.lock 2>/dev/null; then \
+           echo "$(top_srcdir)/build-aux/moopp $(srcdir)/html-styled-ostream.oo.c $(srcdir)/html-styled-ostream.oo.h $(srcdir)/styled-ostream.oo.h $(srcdir)/ostream.oo.h"; \
+           $(top_srcdir)/build-aux/moopp $(srcdir)/html-styled-ostream.oo.c $(srcdir)/html-styled-ostream.oo.h $(srcdir)/styled-ostream.oo.h $(srcdir)/ostream.oo.h; \
+           result=$$?; rm -rf html-styled-ostream.lock; exit $$result; \
+         else \
+           while test -d html-styled-ostream.lock; do sleep 1; done; \
+           test -f html-styled-ostream.h; \
+         fi; \
+       }
 BUILT_SOURCES += html-styled-ostream.h html-styled-ostream.c html_styled_ostream.priv.h html_styled_ostream.vt.h
 CLEANFILES += html-styled-ostream.h html-styled-ostream.c html_styled_ostream.priv.h html_styled_ostream.vt.h
 
index b297d9dd174aa81b342421316c192091f89ae885..3d7c8f11c6cb12ad0769166c76e1301c6a94b033 100644 (file)
@@ -18,8 +18,22 @@ configure.ac:
 
 Makefile.am:
 lib_SOURCES += iconv-ostream.c
-iconv-ostream.h iconv-ostream.c : $(top_srcdir)/build-aux/moopp iconv-ostream.oo.h iconv-ostream.oo.c ostream.oo.h
+# This is a Makefile rule that generates multiple files at once; see the
+# automake documentation, node "Multiple Outputs", for details.
+iconv-ostream.h : $(top_srcdir)/build-aux/moopp iconv-ostream.oo.h iconv-ostream.oo.c ostream.oo.h
        $(top_srcdir)/build-aux/moopp $(srcdir)/iconv-ostream.oo.c $(srcdir)/iconv-ostream.oo.h $(srcdir)/ostream.oo.h
+iconv-ostream.c : iconv-ostream.h
+       @test -f $@ || { \
+         trap 'rm -rf iconv-ostream.lock' 1 2 13 15; \
+         if mkdir iconv-ostream.lock 2>/dev/null; then \
+           echo "$(top_srcdir)/build-aux/moopp $(srcdir)/iconv-ostream.oo.c $(srcdir)/iconv-ostream.oo.h $(srcdir)/ostream.oo.h"; \
+           $(top_srcdir)/build-aux/moopp $(srcdir)/iconv-ostream.oo.c $(srcdir)/iconv-ostream.oo.h $(srcdir)/ostream.oo.h; \
+           result=$$?; rm -rf iconv-ostream.lock; exit $$result; \
+         else \
+           while test -d iconv-ostream.lock; do sleep 1; done; \
+           test -f iconv-ostream.h; \
+         fi; \
+       }
 BUILT_SOURCES += iconv-ostream.h iconv-ostream.c iconv_ostream.priv.h iconv_ostream.vt.h
 CLEANFILES += iconv-ostream.h iconv-ostream.c iconv_ostream.priv.h iconv_ostream.vt.h
 
index f3cd514c8ded444e9870ec8bad34c66b31374ff1..c92e9c5f0097a56492c9e1cb35a93cce0278a388 100644 (file)
@@ -17,8 +17,22 @@ configure.ac:
 
 Makefile.am:
 lib_SOURCES += memory-ostream.c
-memory-ostream.h memory-ostream.c : $(top_srcdir)/build-aux/moopp memory-ostream.oo.h memory-ostream.oo.c ostream.oo.h
+# This is a Makefile rule that generates multiple files at once; see the
+# automake documentation, node "Multiple Outputs", for details.
+memory-ostream.h : $(top_srcdir)/build-aux/moopp memory-ostream.oo.h memory-ostream.oo.c ostream.oo.h
        $(top_srcdir)/build-aux/moopp $(srcdir)/memory-ostream.oo.c $(srcdir)/memory-ostream.oo.h $(srcdir)/ostream.oo.h
+memory-ostream.c : memory-ostream.h
+       @test -f $@ || { \
+         trap 'rm -rf memory-ostream.lock' 1 2 13 15; \
+         if mkdir memory-ostream.lock 2>/dev/null; then \
+           echo "$(top_srcdir)/build-aux/moopp $(srcdir)/memory-ostream.oo.c $(srcdir)/memory-ostream.oo.h $(srcdir)/ostream.oo.h"; \
+           $(top_srcdir)/build-aux/moopp $(srcdir)/memory-ostream.oo.c $(srcdir)/memory-ostream.oo.h $(srcdir)/ostream.oo.h; \
+           result=$$?; rm -rf memory-ostream.lock; exit $$result; \
+         else \
+           while test -d memory-ostream.lock; do sleep 1; done; \
+           test -f memory-ostream.h; \
+         fi; \
+       }
 BUILT_SOURCES += memory-ostream.h memory-ostream.c memory_ostream.priv.h memory_ostream.vt.h
 CLEANFILES += memory-ostream.h memory-ostream.c memory_ostream.priv.h memory_ostream.vt.h
 
index 98b0379f5926fd8742b978f387222d840b372735..389de135def6fa63efb495e5ceb2eb1f9b97d71f 100644 (file)
@@ -12,8 +12,22 @@ configure.ac:
 
 Makefile.am:
 lib_SOURCES += ostream.c
-ostream.h ostream.c : $(top_srcdir)/build-aux/moopp ostream.oo.h ostream.oo.c
+# This is a Makefile rule that generates multiple files at once; see the
+# automake documentation, node "Multiple Outputs", for details.
+ostream.h : $(top_srcdir)/build-aux/moopp ostream.oo.h ostream.oo.c
        $(top_srcdir)/build-aux/moopp $(srcdir)/ostream.oo.c $(srcdir)/ostream.oo.h
+ostream.c : ostream.h
+       @test -f $@ || { \
+         trap 'rm -rf ostream.lock' 1 2 13 15; \
+         if mkdir ostream.lock 2>/dev/null; then \
+           echo "$(top_srcdir)/build-aux/moopp $(srcdir)/ostream.oo.c $(srcdir)/ostream.oo.h"; \
+           $(top_srcdir)/build-aux/moopp $(srcdir)/ostream.oo.c $(srcdir)/ostream.oo.h; \
+           result=$$?; rm -rf ostream.lock; exit $$result; \
+         else \
+           while test -d ostream.lock; do sleep 1; done; \
+           test -f ostream.h; \
+         fi; \
+       }
 BUILT_SOURCES += ostream.h ostream.c ostream.priv.h ostream.vt.h
 CLEANFILES += ostream.h ostream.c ostream.priv.h ostream.vt.h
 
index 6570ae9bb28d50dc0a2ac699035df72668b05cab..884192d953e918ed9fabd0c2039642c31ef4d438 100644 (file)
@@ -12,8 +12,22 @@ configure.ac:
 
 Makefile.am:
 lib_SOURCES += styled-ostream.c
-styled-ostream.h styled-ostream.c : $(top_srcdir)/build-aux/moopp styled-ostream.oo.h styled-ostream.oo.c ostream.oo.h
+# This is a Makefile rule that generates multiple files at once; see the
+# automake documentation, node "Multiple Outputs", for details.
+styled-ostream.h : $(top_srcdir)/build-aux/moopp styled-ostream.oo.h styled-ostream.oo.c ostream.oo.h
        $(top_srcdir)/build-aux/moopp $(srcdir)/styled-ostream.oo.c $(srcdir)/styled-ostream.oo.h $(srcdir)/ostream.oo.h
+styled-ostream.c : styled-ostream.h
+       @test -f $@ || { \
+         trap 'rm -rf styled-ostream.lock' 1 2 13 15; \
+         if mkdir styled-ostream.lock 2>/dev/null; then \
+           echo "$(top_srcdir)/build-aux/moopp $(srcdir)/styled-ostream.oo.c $(srcdir)/styled-ostream.oo.h $(srcdir)/ostream.oo.h"; \
+           $(top_srcdir)/build-aux/moopp $(srcdir)/styled-ostream.oo.c $(srcdir)/styled-ostream.oo.h $(srcdir)/ostream.oo.h; \
+           result=$$?; rm -rf styled-ostream.lock; exit $$result; \
+         else \
+           while test -d styled-ostream.lock; do sleep 1; done; \
+           test -f styled-ostream.h; \
+         fi; \
+       }
 BUILT_SOURCES += styled-ostream.h styled-ostream.c styled_ostream.priv.h styled_ostream.vt.h
 CLEANFILES += styled-ostream.h styled-ostream.c styled_ostream.priv.h styled_ostream.vt.h
 
index 4ece7dd38625ede96fb30e3d5c66bb1a0abb3b8b..e7fb881c0165e2988ab12086d7f79a974ccccbec 100644 (file)
@@ -23,8 +23,22 @@ gl_TERM_OSTREAM
 
 Makefile.am:
 lib_SOURCES += term-ostream.c
-term-ostream.h term-ostream.c : $(top_srcdir)/build-aux/moopp term-ostream.oo.h term-ostream.oo.c ostream.oo.h
+# This is a Makefile rule that generates multiple files at once; see the
+# automake documentation, node "Multiple Outputs", for details.
+term-ostream.h : $(top_srcdir)/build-aux/moopp term-ostream.oo.h term-ostream.oo.c ostream.oo.h
        $(top_srcdir)/build-aux/moopp $(srcdir)/term-ostream.oo.c $(srcdir)/term-ostream.oo.h $(srcdir)/ostream.oo.h
+term-ostream.c : term-ostream.h
+       @test -f $@ || { \
+         trap 'rm -rf term-ostream.lock' 1 2 13 15; \
+         if mkdir term-ostream.lock 2>/dev/null; then \
+           echo "$(top_srcdir)/build-aux/moopp $(srcdir)/term-ostream.oo.c $(srcdir)/term-ostream.oo.h $(srcdir)/ostream.oo.h"; \
+           $(top_srcdir)/build-aux/moopp $(srcdir)/term-ostream.oo.c $(srcdir)/term-ostream.oo.h $(srcdir)/ostream.oo.h; \
+           result=$$?; rm -rf term-ostream.lock; exit $$result; \
+         else \
+           while test -d term-ostream.lock; do sleep 1; done; \
+           test -f term-ostream.h; \
+         fi; \
+       }
 BUILT_SOURCES += term-ostream.h term-ostream.c term_ostream.priv.h term_ostream.vt.h
 CLEANFILES += term-ostream.h term-ostream.c term_ostream.priv.h term_ostream.vt.h
 
index 230a88b706b09d07767df5ec8cbf285de26f8b8b..10735359325ebc86549f22e39da5843b766b5c5d 100644 (file)
@@ -17,8 +17,22 @@ configure.ac:
 
 Makefile.am:
 lib_SOURCES += term-styled-ostream.c
-term-styled-ostream.h term-styled-ostream.c : $(top_srcdir)/build-aux/moopp term-styled-ostream.oo.h term-styled-ostream.oo.c styled-ostream.oo.h ostream.oo.h
+# This is a Makefile rule that generates multiple files at once; see the
+# automake documentation, node "Multiple Outputs", for details.
+term-styled-ostream.h : $(top_srcdir)/build-aux/moopp term-styled-ostream.oo.h term-styled-ostream.oo.c styled-ostream.oo.h ostream.oo.h
        $(top_srcdir)/build-aux/moopp $(srcdir)/term-styled-ostream.oo.c $(srcdir)/term-styled-ostream.oo.h $(srcdir)/styled-ostream.oo.h $(srcdir)/ostream.oo.h
+term-styled-ostream.c : term-styled-ostream.h
+       @test -f $@ || { \
+         trap 'rm -rf term-styled-ostream.lock' 1 2 13 15; \
+         if mkdir term-styled-ostream.lock 2>/dev/null; then \
+           echo "$(top_srcdir)/build-aux/moopp $(srcdir)/term-styled-ostream.oo.c $(srcdir)/term-styled-ostream.oo.h $(srcdir)/styled-ostream.oo.h $(srcdir)/ostream.oo.h"; \
+           $(top_srcdir)/build-aux/moopp $(srcdir)/term-styled-ostream.oo.c $(srcdir)/term-styled-ostream.oo.h $(srcdir)/styled-ostream.oo.h $(srcdir)/ostream.oo.h; \
+           result=$$?; rm -rf term-styled-ostream.lock; exit $$result; \
+         else \
+           while test -d term-styled-ostream.lock; do sleep 1; done; \
+           test -f term-styled-ostream.h; \
+         fi; \
+       }
 BUILT_SOURCES += term-styled-ostream.h term-styled-ostream.c term_styled_ostream.priv.h term_styled_ostream.vt.h
 CLEANFILES += term-styled-ostream.h term-styled-ostream.c term_styled_ostream.priv.h term_styled_ostream.vt.h