poke-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

poke.pc and parallel make


From: Jose E. Marchesi
Subject: poke.pc and parallel make
Date: Sun, 02 May 2021 23:16:14 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)

Hi people!

make -j is broken is currently broken in poke, in both master and
maint/poke-1.

I narrowed it to two different problems:

1) The rule that runs jitterc and generates pvm-vm.h, pvm-vm1.c and
   pvm-vm2.c didn't work with parallel make.  I used the idiom
   recommended by Bruno in the patch below, and that we were already
   using for the flex and bison files.  Seems to work well.

2) The creation of poke.pc (the pkgconfig thing) fails:

   make[2]: *** No rule to make target 'poke.pc', needed by 'all-am'.
   Stop.
   make[2]: *** Waiting for unfinished jobs....

   I have no idea why it is failing.  The whole creation of poke.pc is
   handled by an AX macro in configure.ac:

   dnl pkg-config description
   AX_CREATE_PKGCONFIG_INFO('libpoke/poke.pc', , , 'libpoke')

   And it is not clear to me how it works.

Somebody knows how AX_CREATE_PKGCONFIG_INFO works and what may be the
problem??

commit b5a823ac95eacd832336ffb75bcdc7a49a48c76d (HEAD -> master, origin/master, 
origin/HEAD)
Author: Jose E. Marchesi <jose.marchesi@oracle.com>
Date:   Sun May 2 23:09:22 2021 +0200

    build: fix jitterc rule for parallel make
    
    2021-05-02  Jose E. Marchesi  <jemarch@gnu.org>
    
            * libpoke/Makefile.am (generate-vm-files): New rule.
            (pvm-vm.h): Likewise.
            (pvm-vm1.c): Likewise.
            (pvm-vm2.c): Likewise.

diff --git a/ChangeLog b/ChangeLog
index 8ada41ee..9d611c16 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2021-05-02  Jose E. Marchesi  <jemarch@gnu.org>
+
+       * libpoke/Makefile.am (generate-vm-files): New rule.
+       (pvm-vm.h): Likewise.
+       (pvm-vm1.c): Likewise.
+       (pvm-vm2.c): Likewise.
+
 2021-05-02  Jose E. Marchesi  <jemarch@gnu.org>
 
        * libpoke/Makefile.am (MAINTAINERCLEANFILES): Add jitterc
diff --git a/libpoke/Makefile.am b/libpoke/Makefile.am
index 11cfe3dc..143ce152 100644
--- a/libpoke/Makefile.am
+++ b/libpoke/Makefile.am
@@ -221,7 +221,10 @@ libpoke_la_CPPFLAGS += $(JITTER_CPPFLAGS)
 BUILT_SOURCES += pvm-vm.h pvm-vm1.c pvm-vm2.c
 MAINTAINERCLEANFILES += $(srcdir)/pvm-vm.h $(srcdir)/pvm-vm1.c 
$(srcdir)/pvm-vm2.c
 
-pvm-vm.h pvm-vm1.c pvm-vm2.c: pvm.jitter
+# Since this is a rule that produces multiple files, we apply the idiom from
+# <https://lists.gnu.org/archive/html/bug-make/2020-09/msg00008.html>, so that
+# it works also in parallel 'make'.
+generate-vm-files:
        $(JITTER) $(srcdir)/pvm.jitter --output $(builddir) \
        && { test $(builddir) = $(srcdir) \
             || { mv pvm-vm.h $(srcdir)/pvm-vm.h \
@@ -230,5 +233,14 @@ pvm-vm.h pvm-vm1.c pvm-vm2.c: pvm.jitter
                }; \
           } \
        || { rm -f pvm-vm.h pvm-vm1.c pvm-vm2.c; false; }
+.PHONY: generate-vm-files
+# The above rule will generate files with time-stamp order
+# pvm.jitter <= pvm-vm.h <= pvm-vm1.c <= pvm-vm2.c
+pvm-vm.h: pvm.jitter
+       @{ test -f $(srcdir)/pvm-vm.h && test ! $(srcdir)/pvm-vm.h -ot 
$(srcdir)/pvm.jitter; } || $(MAKE) generate-vm-files
+pvm-vm1.c: pvm-vm.h
+       @{ test -f $(srcdir)/pvm-vm1.c && test ! $(srcdir)/pvm-vm1.c -ot 
$(srcdir)/pvm-vm.h; } || $(MAKE) generate-vm-files
+pvm-vm2.c: pvm-vm1.c
+       @{ test -f $(srcdir)/pvm-vm2.c && test ! $(srcdir)/pvm-vm2.c -ot 
$(srcdir)/pvm-vm1.c; } || $(MAKE) generate-vm-files
 
 # End of Makefile.am




reply via email to

[Prev in Thread] Current Thread [Next in Thread]