>From 32bc5a79371c184de3a2e2e5e97029e527ec1066 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miguel=20=C3=81ngel=20Arruga=20Vivas?= Date: Sun, 12 May 2019 03:03:19 +0200 Subject: [PATCH] build: Fix parallel compilation. * gettext-tools/src/Makefile.am (textstyle/stdbool.h, textstyle/version.h, textstyle/woe32dll.h): Split make target from here ... (textstyle.h): ... to here. The old recipe is kept here. (po-gram-gen.h): Add a warning message to explain why the dependency chain is kept explicit, and split make target from here ... (po-gram-gen.c): ... to here. The old recipe is kept here. (po-lex.o po-lex.lo): Remove explicit target declaration on automake generated targets. (po-lex.h): Add new dependency to po-gram-gen2.h. (cldr-plural.h): Split make target from here ... (cldr-plural.c): ... to here. The old recipe is kept here. (.NOPARALLEL): Revert commit 7e78b48b321e36433abeb4ff1b73375455e74f83. --- gettext-tools/src/Makefile.am | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/gettext-tools/src/Makefile.am b/gettext-tools/src/Makefile.am index b98b7abd3..ba4af8989 100644 --- a/gettext-tools/src/Makefile.am +++ b/gettext-tools/src/Makefile.am @@ -251,7 +251,8 @@ cldr_plurals_CFLAGS = $(AM_CFLAGS) $(INCXML) cldr_plurals_LDADD = libgettextsrc.la $(LDADD) # How to get the include files of libtextstyle. -textstyle.h textstyle/stdbool.h textstyle/version.h textstyle/woe32dll.h: +textstyle/stdbool.h textstyle/version.h textstyle/woe32dll.h: textstyle.h +textstyle.h: here=`pwd`; \ cd ../../libtextstyle/lib && \ $(MAKE) install-nobase_includeHEADERS install-nobase_nodist_includeHEADERS includedir="$$here" @@ -490,7 +491,15 @@ endif # leads to error if 'lcov' is used later. # Therefore we override this rule. -po-gram-gen.c po-gram-gen.h: po-gram-gen.y +# WARNING: We must not add extra targets to the original rule, as this +# causes issues with parallel make, so the generation phase is only +# executed once for each update. We need to make explicit the +# dependency chain for po-gram-gen.h, as it is used for po-gram-gen2.h +# generation, and that file is inserted into the dependency chain of +# po-lex.h. + +po-gram-gen.h: po-gram-gen.c +po-gram-gen.c: po-gram-gen.y $(AM_V_GEN)$(SHELL) $(YLWRAP) $(srcdir)/po-gram-gen.y \ y.tab.c po-gram-gen.c \ y.tab.h po-gram-gen.h \ @@ -515,9 +524,10 @@ MOSTLYCLEANFILES += po-gram-gen2.h-tmp MAINTAINERCLEANFILES += po-gram-gen2.h EXTRA_DIST += po-gram-gen2.h -po-lex.o po-lex.lo: po-gram-gen2.h +po-lex.h: po-gram-gen2.h -cldr-plural.c cldr-plural.h: cldr-plural.y +cldr-plural.h: cldr-plural.c +cldr-plural.c: cldr-plural.y $(AM_V_GEN)$(SHELL) $(YLWRAP) $(srcdir)/cldr-plural.y \ y.tab.c cldr-plural.c \ y.tab.h cldr-plural.h \ @@ -667,10 +677,3 @@ MOSTLYCLEANFILES += gettext.res else WOE32_LDADD = endif - - -# This Makefile contains rules which don't work with parallel make, -# namely those which build textstyle.h, po-gram-gen.c, cldr-plural.c. -# See . -# So, turn off parallel execution in this Makefile. -.NOTPARALLEL: -- 2.21.0