summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNoah Slater <nslater@apache.org>2012-12-06 22:19:28 +0000
committerDave Cottlehuber <dch@apache.org>2012-12-11 22:01:23 +0100
commit6c3c7b83a4eee441d8449fd391e0385c48811785 (patch)
tree933045b97b50c690f44816e8ddc0e9d60ce68fe7
parent3734f5da1a1e3e2bc62bb5f50dce9343118e2a99 (diff)
downloadcouchdb-6c3c7b83a4eee441d8449fd391e0385c48811785.tar.gz
Added support for `make -j` and `make -n`
-rw-r--r--bin/Makefile.am4
-rw-r--r--share/doc/build/Makefile.am80
-rw-r--r--src/couchdb/priv/Makefile.am4
3 files changed, 60 insertions, 28 deletions
diff --git a/bin/Makefile.am b/bin/Makefile.am
index d666bbd1c..3d7a075df 100644
--- a/bin/Makefile.am
+++ b/bin/Makefile.am
@@ -10,6 +10,8 @@
## License for the specific language governing permissions and limitations under
## the License.
+MAKE_SAFE = $(MAKE)
+
if WINDOWS
bin_SCRIPTS = couchdb.bat
else
@@ -122,7 +124,7 @@ couch-config_dev: couch-config.tpl
# Depend on source files so distributed man pages are not rebuilt for end user.
$(man_file): couchdb.tpl.in
- $(MAKE) -f Makefile couchdb; \
+ $(MAKE_SAFE) -f Makefile couchdb; \
$(top_srcdir)/build-aux/missing --run \
help2man \
--no-info \
diff --git a/share/doc/build/Makefile.am b/share/doc/build/Makefile.am
index 5346d8c9e..e06b21af7 100644
--- a/share/doc/build/Makefile.am
+++ b/share/doc/build/Makefile.am
@@ -10,9 +10,10 @@
## License for the specific language governing permissions and limitations under
## the License.
+MAKE_SAFE = $(MAKE)
+
SPHINXOPTS = \
- -d doctrees \
- -n -c $(srcdir)/../src \ \
+ -n -c $(srcdir)/../src \
-A local=1 \
$(srcdir)/../src
@@ -201,47 +202,74 @@ $(html_files): html
$(info_file_dist): info.stamp
@if test -f $@; then :; else \
rm -f info.stamp; \
- $(MAKE) $(AM_MAKEFLAGS) info.stamp; \
+ $(MAKE_SAFE) $(AM_MAKEFLAGS) info.stamp; \
fi
info.stamp: $(image_files) $(src_files)
- @rm -f info.tmp
- @touch info.tmp
- $(top_srcdir)/build-aux/sphinx-build \
- -b texinfo $(SPHINXOPTS) $(builddir)/texinfo
- $(MAKE) -C texinfo info
- $(top_srcdir)/build-aux/sphinx-touch $(info_file_dist)
- @mv -f info.tmp $@
+ trap "rm -rf info.lock info.stamp" 1 2 13 15; \
+ if mkdir info.lock 2>/dev/null; then \
+ rm -f info.tmp; \
+ touch info.tmp; \
+ $(top_srcdir)/build-aux/sphinx-build \
+ -b texinfo $(SPHINXOPTS) $(builddir)/texinfo; \
+ $(MAKE_SAFE) -C texinfo info; \
+ $(top_srcdir)/build-aux/sphinx-touch $(info_file_dist); \
+ mv -f info.tmp $@; \
+ rmdir info.lock; \
+ else \
+ while test -d info.lock; do \
+ sleep 1; \
+ done; \
+ test -f info.stamp; \
+ fi
$(pdf_file_dist): pdf.stamp
@if test -f $@; then :; else \
rm -f pdf.stamp; \
- $(MAKE) $(AM_MAKEFLAGS) pdf.stamp; \
+ $(MAKE_SAFE) $(AM_MAKEFLAGS) pdf.stamp; \
fi
pdf.stamp: $(image_files) $(src_files)
- @rm -f pdf.tmp
- @touch pdf.tmp
- $(top_srcdir)/build-aux/sphinx-build \
- -b latex $(SPHINXOPTS) $(builddir)/latex
- $(MAKE) -C latex all-pdf
- $(top_srcdir)/build-aux/sphinx-touch latex/CouchDB.pdf
- gzip -9 < latex/CouchDB.pdf > $(pdf_file_dist)
- @mv -f pdf.tmp $@
+ trap "rm -rf pdf.lock pdf.stamp" 1 2 13 15; \
+ if mkdir pdf.lock 2>/dev/null; then \
+ rm -f pdf.tmp; \
+ touch pdf.tmp; \
+ $(top_srcdir)/build-aux/sphinx-build \
+ -b latex $(SPHINXOPTS) $(builddir)/latex; \
+ $(MAKE_SAFE) -C latex all-pdf; \
+ $(top_srcdir)/build-aux/sphinx-touch latex/CouchDB.pdf; \
+ gzip -9 < latex/CouchDB.pdf > $(pdf_file_dist); \
+ mv -f pdf.tmp $@; \
+ rmdir pdf.lock; \
+ else \
+ while test -d pdf.lock; do \
+ sleep 1; \
+ done; \
+ test -f pdf.stamp; \
+ fi
$(html_files): html.stamp
@if test -f $@; then :; else \
rm -f html.stamp; \
- $(MAKE) $(AM_MAKEFLAGS) html.stamp; \
+ $(MAKE_SAFE) $(AM_MAKEFLAGS) html.stamp; \
fi
html.stamp: $(image_files) $(src_files) $(src_files_html)
- @rm -f html.tmp
- @touch html.tmp
- $(top_srcdir)/build-aux/sphinx-build \
- -b html $(SPHINXOPTS) $(builddir)/html
- $(top_srcdir)/build-aux/sphinx-touch $(html_files)
- @mv -f html.tmp $@
+ trap "rm -rf html.lock html.stamp" 1 2 13 15; \
+ if mkdir html.lock 2>/dev/null; then \
+ rm -f html.tmp; \
+ touch html.tmp; \
+ $(top_srcdir)/build-aux/sphinx-build \
+ -b html $(SPHINXOPTS) $(builddir)/html; \
+ $(top_srcdir)/build-aux/sphinx-touch $(html_files); \
+ mv -f html.tmp $@; \
+ rmdir html.lock; \
+ else \
+ while test -d html.lock; do \
+ sleep 1; \
+ done; \
+ test -f html.stamp; \
+ fi
pdf-local:
$(MAKE) $(AM_MAKEFLAGS) pdf.stamp
diff --git a/src/couchdb/priv/Makefile.am b/src/couchdb/priv/Makefile.am
index 8fce9d05f..9a24222f1 100644
--- a/src/couchdb/priv/Makefile.am
+++ b/src/couchdb/priv/Makefile.am
@@ -10,6 +10,8 @@
## License for the specific language governing permissions and limitations under
## the License.
+MAKE_SAFE = $(MAKE)
+
couchlibdir = $(localerlanglibdir)/couch-$(version)
couchprivdir = $(couchlibdir)/priv
couchprivlibdir = $(couchlibdir)/priv/lib
@@ -77,7 +79,7 @@ couchpriv_PROGRAMS = couchspawnkillable
# Depend on source files so distributed man pages are not rebuilt for end user.
$(man_file): $(COUCHJS_SRCS)
- $(MAKE) -f Makefile couchjs; \
+ $(MAKE_SAFE) -f Makefile couchjs; \
$(top_srcdir)/build-aux/missing --run \
help2man \
--no-info \