summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoreb2008-03-03 22:14:50 +0000
committereb2008-03-03 22:14:50 +0000
commita2bc656be80e36e8ff80364a7ca51a91ffb2c009 (patch)
tree66d7bdc2f19a21ab208e3aa5900ea06e9ffeeba9
parentbd31e949498e722db8a0ebad5b5215a1fb8f73af (diff)
downloadgnuradio-a2bc656be80e36e8ff80364a7ca51a91ffb2c009.tar.gz
gnuradio-a2bc656be80e36e8ff80364a7ca51a91ffb2c009.tar.bz2
gnuradio-a2bc656be80e36e8ff80364a7ca51a91ffb2c009.zip
Fix for ticket:236, parallel makes are indeterminate.
Merged eb/pmake r7909:7911 into trunk git-svn-id: http://gnuradio.org/svn/gnuradio/trunk@7912 221aa14e-8319-0410-a670-987f0aec2ac5
-rw-r--r--gnuradio-core/src/lib/filter/Makefile.am28
-rw-r--r--gnuradio-core/src/lib/gengen/Makefile.am28
-rw-r--r--gr-trellis/src/lib/Makefile.am31
-rw-r--r--pmt/src/lib/Makefile.am28
4 files changed, 109 insertions, 6 deletions
diff --git a/gnuradio-core/src/lib/filter/Makefile.am b/gnuradio-core/src/lib/filter/Makefile.am
index ca5838510..1b1a0c0a8 100644
--- a/gnuradio-core/src/lib/filter/Makefile.am
+++ b/gnuradio-core/src/lib/filter/Makefile.am
@@ -64,9 +64,35 @@ CODE_GENERATOR = \
include $(srcdir)/Makefile.gen
-$(srcdir)/Makefile.gen $(GENERATED_H) $(GENERATED_I) $(GENERATED_CC): $(CODE_GENERATOR)
+# Ensure parallel does the right thing.
+# http://sources.redhat.com/automake/automake.html#Multiple-Outputs
+
+generate-stamp: $(CODE_GENERATOR)
+ @rm -f generate-tmp
+ @touch generate-tmp
PYTHONPATH=$(top_srcdir)/gnuradio-core/src/python srcdir=$(srcdir) $(PYTHON) $(srcdir)/generate_all.py
touch $(srcdir)/Makefile.in
+ @mv -f generate-tmp $@
+
+
+$(srcdir)/Makefile.gen $(GENERATED_H) $(GENERATED_I) $(GENERATED_CC): generate-stamp
+## Recover from the removal of $@
+ @if test -f $@; then :; else \
+ trap 'rm -rf generate-lock generate-stamp' 1 2 13 15; \
+ if mkdir generate-lock 2>/dev/null; then \
+## This code is being executed by the first process.
+ rm -f generate-stamp; \
+ $(MAKE) $(AM_MAKEFLAGS) generate-stamp; \
+ rmdir generate-lock; \
+ else \
+## This code is being executed by the follower processes.
+## Wait until the first process is done.
+ while test -d generate-lock; do sleep 1; done; \
+## Succeed if and only if the first process succeeded.
+ test -f generate-stamp; exit $$?; \
+ fi; \
+ fi
+
BUILT_SOURCES = $(GENERATED_H) $(GENERATED_I) $(GENERATED_CC)
diff --git a/gnuradio-core/src/lib/gengen/Makefile.am b/gnuradio-core/src/lib/gengen/Makefile.am
index b1a3b2613..a4330f103 100644
--- a/gnuradio-core/src/lib/gengen/Makefile.am
+++ b/gnuradio-core/src/lib/gengen/Makefile.am
@@ -113,9 +113,35 @@ CODE_GENERATOR = \
include $(srcdir)/Makefile.gen
-$(srcdir)/Makefile.gen $(GENERATED_H) $(GENERATED_I) $(GENERATED_CC): $(CODE_GENERATOR)
+# Ensure parallel does the right thing.
+# http://sources.redhat.com/automake/automake.html#Multiple-Outputs
+
+generate-stamp: $(CODE_GENERATOR)
+ @rm -f generate-tmp
+ @touch generate-tmp
PYTHONPATH=$(top_srcdir)/gnuradio-core/src/python srcdir=$(srcdir) $(PYTHON) $(srcdir)/generate_all.py
touch $(srcdir)/Makefile.in
+ @mv -f generate-tmp $@
+
+
+$(srcdir)/Makefile.gen $(GENERATED_H) $(GENERATED_I) $(GENERATED_CC): generate-stamp
+## Recover from the removal of $@
+ @if test -f $@; then :; else \
+ trap 'rm -rf generate-lock generate-stamp' 1 2 13 15; \
+ if mkdir generate-lock 2>/dev/null; then \
+## This code is being executed by the first process.
+ rm -f generate-stamp; \
+ $(MAKE) $(AM_MAKEFLAGS) generate-stamp; \
+ rmdir generate-lock; \
+ else \
+## This code is being executed by the follower processes.
+## Wait until the first process is done.
+ while test -d generate-lock; do sleep 1; done; \
+## Succeed if and only if the first process succeeded.
+ test -f generate-stamp; exit $$?; \
+ fi; \
+ fi
+
BUILT_SOURCES = $(GENERATED_H) $(GENERATED_I) $(GENERATED_CC)
diff --git a/gr-trellis/src/lib/Makefile.am b/gr-trellis/src/lib/Makefile.am
index 9eeb3e043..62a8bc94b 100644
--- a/gr-trellis/src/lib/Makefile.am
+++ b/gr-trellis/src/lib/Makefile.am
@@ -54,10 +54,35 @@ CODE_GENERATOR = \
include $(srcdir)/Makefile.gen
-$(srcdir)/Makefile.gen $(GENERATED_H) $(GENERATED_I) $(GENERATED_CC): $(CODE_GENERATOR)
- PYTHONPATH=$(top_srcdir)/gnuradio-core/src/python \
- srcdir=$(srcdir) $(PYTHON) $(srcdir)/generate_all.py
+
+# Ensure parallel does the right thing.
+# http://sources.redhat.com/automake/automake.html#Multiple-Outputs
+
+generate-stamp: $(CODE_GENERATOR)
+ @rm -f generate-tmp
+ @touch generate-tmp
+ PYTHONPATH=$(top_srcdir)/gnuradio-core/src/python srcdir=$(srcdir) $(PYTHON) $(srcdir)/generate_all.py
touch $(srcdir)/Makefile.in
+ @mv -f generate-tmp $@
+
+$(srcdir)/Makefile.gen $(GENERATED_H) $(GENERATED_I) $(GENERATED_CC): generate-stamp
+## Recover from the removal of $@
+ @if test -f $@; then :; else \
+ trap 'rm -rf generate-lock generate-stamp' 1 2 13 15; \
+ if mkdir generate-lock 2>/dev/null; then \
+## This code is being executed by the first process.
+ rm -f generate-stamp; \
+ $(MAKE) $(AM_MAKEFLAGS) generate-stamp; \
+ rmdir generate-lock; \
+ else \
+## This code is being executed by the follower processes.
+## Wait until the first process is done.
+ while test -d generate-lock; do sleep 1; done; \
+## Succeed if and only if the first process succeeded.
+ test -f generate-stamp; exit $$?; \
+ fi; \
+ fi
+
# These files are built by SWIG. The first is the C++ glue.
# The second is the python wrapper that loads the _trellis shared library
diff --git a/pmt/src/lib/Makefile.am b/pmt/src/lib/Makefile.am
index 1ea670281..16834746d 100644
--- a/pmt/src/lib/Makefile.am
+++ b/pmt/src/lib/Makefile.am
@@ -46,8 +46,34 @@ GENERATED_CC = \
qa_pmt_unv.cc
-$(GENERATED_H) $(GENERATED_I) $(GENERATED_CC): $(CODE_GENERATOR)
+
+# Ensure parallel does the right thing.
+# http://sources.redhat.com/automake/automake.html#Multiple-Outputs
+
+generate-stamp: $(CODE_GENERATOR)
+ @rm -f generate-tmp
+ @touch generate-tmp
PYTHONPATH=$(top_srcdir)/pmt/src/lib srcdir=$(srcdir) $(PYTHON) $(srcdir)/generate_unv.py
+ @mv -f generate-tmp $@
+
+$(GENERATED_H) $(GENERATED_I) $(GENERATED_CC): generate-stamp
+## Recover from the removal of $@
+ @if test -f $@; then :; else \
+ trap 'rm -rf generate-lock generate-stamp' 1 2 13 15; \
+ if mkdir generate-lock 2>/dev/null; then \
+## This code is being executed by the first process.
+ rm -f generate-stamp; \
+ $(MAKE) $(AM_MAKEFLAGS) generate-stamp; \
+ rmdir generate-lock; \
+ else \
+## This code is being executed by the follower processes.
+## Wait until the first process is done.
+ while test -d generate-lock; do sleep 1; done; \
+## Succeed if and only if the first process succeeded.
+ test -f generate-stamp; exit $$?; \
+ fi; \
+ fi
+
pmt_serial_tags.h: $(srcdir)/../scheme/gnuradio/gen-serial-tags.scm $(srcdir)/../scheme/gnuradio/pmt-serial-tags.scm
$(RUN_GUILE) $(srcdir)/../scheme/gnuradio/gen-serial-tags.scm $(srcdir)/../scheme/gnuradio/pmt-serial-tags.scm pmt_serial_tags.h