>From 34184eeccab45fe6ca7d44601d2000b9b3bfb688 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miguel=20=C3=81ngel=20Arruga=20Vivas?= Date: Mon, 13 May 2019 13:48:59 +0200 Subject: [PATCH] build: Fix parallel compilation. * gettext-tools/src/Makefile.am (textstyle/stdbool.h, textstyle/version.h, textstyle/woe32dll.h): Split make target. Call prepare-libtextstyle-headers when the file has been manually removed. (textstyle.h): Call prepare-libtextstyle-headers. (prepare-libtextstyle-headers): New .PHONY target. (po-gram-gen.h): Split make target. Call generate-po-gram-gen when the file has been manually removed. (po-gram-gen.c): Call generate-po-gram-gen. (generate-po-gram-gen): New .PHONY target. (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. Call generate-cldr-plural when the file has been manually removed. (cldr-plural.c): Call generate-cldr-plural. (generate-cldr-plural): New .PHONY target. (AM_V_PREPARE_LIBTEXTSTYLE, AM_V_PREPARE_LIBTEXTSTYLE_, AM_V_PREPARE_LIBTEXTSTYLE_0, AM_V_GENERATE_PO_GRAM_GEN, AM_V_GENERATE_PO_GRAM_GEN_, AM_V_GENERATE_PO_GRAM_GEN_0): New macros for silent output. (.NOPARALLEL): Revert commit 7e78b48b321e36433abeb4ff1b73375455e74f83. --- gettext-tools/src/Makefile.am | 51 ++++++++++++++++++++++++++--------- 1 file changed, 38 insertions(+), 13 deletions(-) diff --git a/gettext-tools/src/Makefile.am b/gettext-tools/src/Makefile.am index b98b7abd3..b112ba8ed 100644 --- a/gettext-tools/src/Makefile.am +++ b/gettext-tools/src/Makefile.am @@ -251,7 +251,19 @@ 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 + test -e "$@" && touch "$@" || \ + $(MAKE) prepare-libtextstyle-headers +textstyle.h: + $(MAKE) prepare-libtextstyle-headers + +AM_V_PREPARE_LIBTEXTSTYLE = $(AM_V_PREPARE_LIBTEXTSTYLE_$(V)) +AM_V_PREPARE_LIBTEXTSTYLE_ = $(AM_V_PREPARE_LIBTEXTSTYLE_$(AM_DEFAULT_VERBOSITY)) +AM_V_PREPARE_LIBTEXTSTYLE_0 = @echo " GEN libtextstyle headers"; + +.PHONY: prepare-libtextstyle-headers +prepare-libtextstyle-headers: + $(AM_V_PREPARE_LIBTEXTSTYLE) \ here=`pwd`; \ cd ../../libtextstyle/lib && \ $(MAKE) install-nobase_includeHEADERS install-nobase_nodist_includeHEADERS includedir="$$here" @@ -490,8 +502,18 @@ 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 - $(AM_V_GEN)$(SHELL) $(YLWRAP) $(srcdir)/po-gram-gen.y \ +po-gram-gen.c: po-gram-gen.h + test -e "$@" && touch "$@" || $(MAKE) generate-po-gram-gen +po-gram-gen.h: po-gram-gen.y + $(MAKE) generate-po-gram-gen + +AM_V_GENERATE_PO_GRAM_GEN = $(AM_V_GENERATE_PO_GRAM_GEN_$(V)) +AM_V_GENERATE_PO_GRAM_GEN_ = $(AM_V_GENERATE_PO_GRAM_GEN_$(AM_DEFAULT_VERBOSITY)) +AM_V_GENERATE_PO_GRAM_GEN_0 = @echo " YACC po-gram-gen.y"; + +.PHONY: generate-po-gram-gen +generate-po-gram-gen: + $(AM_V_GENERATE_PO_GRAM_GEN)$(SHELL) $(YLWRAP) $(srcdir)/po-gram-gen.y \ y.tab.c po-gram-gen.c \ y.tab.h po-gram-gen.h \ y.output po-gram-gen.output \ @@ -515,10 +537,20 @@ 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 + test -e "$@" && touch "$@" || $(MAKE) generate-cldr-plural +cldr-plural.h: cldr-plural.y + $(MAKE) generate-cldr-plural -cldr-plural.c cldr-plural.h: cldr-plural.y - $(AM_V_GEN)$(SHELL) $(YLWRAP) $(srcdir)/cldr-plural.y \ +AM_V_GENERATE_CLDR_PLURAL = $(AM_V_GENERATE_CLDR_PLURAL_$(V)) +AM_V_GENERATE_CLDR_PLURAL_ = $(AM_V_GENERATE_CLDR_PLURAL_$(AM_DEFAULT_VERBOSITY)) +AM_V_GENERATE_CLDR_PLURAL_0 = @echo " YACC cldr-plural.y"; + +.PHONY: generate-cldr-plural +generate-cldr-plural: + $(AM_V_GENERATE_CLDR_PLURAL)$(SHELL) $(YLWRAP) $(srcdir)/cldr-plural.y \ y.tab.c cldr-plural.c \ y.tab.h cldr-plural.h \ y.output cldr-plural.output \ @@ -667,10 +699,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