aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLoïc Hoguin <[email protected]>2015-01-07 15:55:30 +0100
committerLoïc Hoguin <[email protected]>2015-01-07 16:27:47 +0100
commit2a6499a167354f2a1259b28b2c3105f08db977d1 (patch)
tree0c89e3e037e9babcc7c90a1817bdf530d9cec157
parent1f58d8b925b9ca1a00a2cb5e6938bf00b2238848 (diff)
downloaderlang.mk-2a6499a167354f2a1259b28b2c3105f08db977d1.tar.gz
erlang.mk-2a6499a167354f2a1259b28b2c3105f08db977d1.tar.bz2
erlang.mk-2a6499a167354f2a1259b28b2c3105f08db977d1.zip
Fix parallel compilation
Parallel compilation is now only enabled for "make" and "make deps app". To ensure order we spawn a new Make process for "deps", "app" and "rel" when the "all" target (or no target) is used.
-rw-r--r--core/core.mk9
-rw-r--r--core/erlc.mk4
-rw-r--r--erlang.mk15
-rw-r--r--plugins/relx.mk2
4 files changed, 22 insertions, 8 deletions
diff --git a/core/core.mk b/core/core.mk
index 075ee45..a5fbffd 100644
--- a/core/core.mk
+++ b/core/core.mk
@@ -30,7 +30,14 @@ gen_verbose = $(gen_verbose_$(V))
# Core targets.
-all:: deps app rel
+ifneq ($(words $(MAKECMDGOALS)),1)
+.NOTPARALLEL:
+endif
+
+all::
+ @$(MAKE) --no-print-directory deps
+ @$(MAKE) --no-print-directory app
+ @$(MAKE) --no-print-directory rel
clean::
$(gen_verbose) rm -f erl_crash.dump
diff --git a/core/erlc.mk b/core/erlc.mk
index 01bd6e0..8d720aa 100644
--- a/core/erlc.mk
+++ b/core/erlc.mk
@@ -75,11 +75,11 @@ ebin/$(PROJECT).app:: $(shell find mibs -type f -name \*.mib)
endif
ebin/$(PROJECT).app:: $(shell find src -type f -name \*.erl) \
- $(shell find src -type f -name \*.core) | deps
+ $(shell find src -type f -name \*.core)
$(if $(strip $?),$(call compile_erl,$?))
ebin/$(PROJECT).app:: $(shell find src -type f -name \*.xrl) \
- $(shell find src -type f -name \*.yrl) | deps
+ $(shell find src -type f -name \*.yrl)
$(if $(strip $?),$(call compile_xyrl,$?))
endif
diff --git a/erlang.mk b/erlang.mk
index d050dda..2d7e63e 100644
--- a/erlang.mk
+++ b/erlang.mk
@@ -30,7 +30,14 @@ gen_verbose = $(gen_verbose_$(V))
# Core targets.
-all:: deps app rel
+ifneq ($(words $(MAKECMDGOALS)),1)
+.NOTPARALLEL:
+endif
+
+all::
+ @$(MAKE) --no-print-directory deps
+ @$(MAKE) --no-print-directory app
+ @$(MAKE) --no-print-directory rel
clean::
$(gen_verbose) rm -f erl_crash.dump
@@ -279,11 +286,11 @@ ebin/$(PROJECT).app:: $(shell find mibs -type f -name \*.mib)
endif
ebin/$(PROJECT).app:: $(shell find src -type f -name \*.erl) \
- $(shell find src -type f -name \*.core) | deps
+ $(shell find src -type f -name \*.core)
$(if $(strip $?),$(call compile_erl,$?))
ebin/$(PROJECT).app:: $(shell find src -type f -name \*.xrl) \
- $(shell find src -type f -name \*.yrl) | deps
+ $(shell find src -type f -name \*.yrl)
$(if $(strip $?),$(call compile_xyrl,$?))
endif
@@ -1125,7 +1132,7 @@ endef
$(RELX):
@$(call relx_fetch)
-relx-rel: $(RELX) | deps app
+relx-rel: $(RELX)
@$(RELX) -c $(RELX_CONFIG) $(RELX_OPTS)
distclean-relx-rel:
diff --git a/plugins/relx.mk b/plugins/relx.mk
index 9e6f556..8b66277 100644
--- a/plugins/relx.mk
+++ b/plugins/relx.mk
@@ -38,7 +38,7 @@ endef
$(RELX):
@$(call relx_fetch)
-relx-rel: $(RELX) | deps app
+relx-rel: $(RELX)
@$(RELX) -c $(RELX_CONFIG) $(RELX_OPTS)
distclean-relx-rel: