--On August 27, 2006 3:22:50 PM +0200 Christian Stimming <[EMAIL PROTECTED]> wrote:

I dont think this has to be done from install.sh.  I think the
makefiles can (should?) just be changed to do this.  This way we can
clean it up via "make clean".  I think the only things that need to
be copied are the g-wrapped scheme files.

See attached patch for gnc-module/Makefile.am.

This thread reminds me of something I had been meaning to mention for some time which is related to this same part of Makefile.am. The current construct (and the modified one) doesn't work well with parallel builds (with -j other than one). The problem is that the dependencies like

gw-gnc-module.scm gw-gnc-module.c gw-gnc-module.h: \
 .scm-links gw-gnc-module-spec.scm ${top_builddir}/config.status
       ... do something ...

are equivalent to the three dependencies

gw-gnc-module.scm: \
 .scm-links gw-gnc-module-spec.scm ${top_builddir}/config.status
       ... do something ...

gw-gnc-module.c: \
 .scm-links gw-gnc-module-spec.scm ${top_builddir}/config.status
       ... do something ...

gw-gnc-module.h: \
 .scm-links gw-gnc-module-spec.scm ${top_builddir}/config.status
       ... do something ...

In other words it tells make that the three targets are independently built using the same commands, rather than all three built by running the commands once.

You see this in a single threaded build where you get a warning from make when it discovers to its surprise that building one of these caused the other two to become up to date, but it doesn't really matter much there. In a parallel build it is much worse where it runs the same commands two or three times at the same time which sometimes produces incomplete output.

There are probably several ways to fix this. One I have been using for several months now without problem is to patch it to look like this:

.INTERMEDIATE: gwrap-files

gw-gnc-module.scm gw-gnc-module.c gw-gnc-module.h: gwrap-files

gwrap-files: \
  .scm-links gw-gnc-module-spec.scm ${top_builddir}/config.status
       ... do something ...
        touch gwrap-files

The intermediate target with no commands solves the problem. I've attached a patch to fix this in gnc-module/Makefile.am. I have similar patches for the other relevant makefiles if you're interested. Since I have a multiprocessor machine, parallel builds help a lot. I can keep on patching the makefiles locally, but others might benefit from this too.

--
Mike Alexander           [EMAIL PROTECTED]
Ann Arbor, MI            PGP key ID: BEA343A6

Index: gnucash-2.0/src/gnc-module/Makefile.am
===================================================================
--- gnucash-2.0/src/gnc-module/Makefile.am      (revision 14695)
+++ gnucash-2.0/src/gnc-module/Makefile.am      (working copy)
@@ -61,12 +61,16 @@
endif
        touch .scm-links

-gw-gnc-module.scm gw-gnc-module.c gw-gnc-module.h: \
-  .scm-links gw-gnc-module-spec.scm ${top_builddir}/config.status
+.INTERMEDIATE: gwrap-files
+
+gw-gnc-module.scm gw-gnc-module.c gw-gnc-module.h: gwrap-files
+
+gwrap-files: .scm-links gw-gnc-module-spec.scm ${top_builddir}/config.status
        FLAVOR=gnome $(GUILE) -c \
          "(set! %load-path (cons \"${G_WRAP_MODULE_DIR}\" %load-path)) \
          (primitive-load \"./gw-gnc-module-spec.scm\") \
          (gw:generate-wrapset \"gw-gnc-module\")"
+       touch gwrap-files

BUILT_SOURCES = gw-gnc-module.scm gw-gnc-module.h gw-gnc-module.c
CLEANFILES = $(BUILT_SOURCES) .scm-links g-wrapped gnucash \
_______________________________________________
gnucash-devel mailing list
[email protected]
https://lists.gnucash.org/mailman/listinfo/gnucash-devel

Reply via email to