From d514facbb41c1b76d76ffe435ccd5174d8c749c2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Hoguin?= Date: Wed, 18 Nov 2015 16:24:36 +0100 Subject: Fix target dependencies and enable parallel again We can now use 'make -j 32' again. All tests pass. There might be some issues left with the areas that are not fully tested yet (some plugins). A few changes in behavior: * 'make app' will also do 'make deps' unless SKIP_DEPS is set. You can use 'make app-build' instead to just build the application. * 'make rel' will also do 'make app' (and therefore deps). There are no alternative target to keep the old behavior at this time. --- build.config | 2 +- core/core.mk | 2 -- core/erlc.mk | 4 ++-- doc/src/guide/app.asciidoc | 28 ++++++++++++++++------------ plugins/relx.mk | 4 ++-- 5 files changed, 21 insertions(+), 19 deletions(-) diff --git a/build.config b/build.config index 674035e..fed0626 100644 --- a/build.config +++ b/build.config @@ -10,6 +10,7 @@ core/index core/deps # Plugins that must run before Erlang code gets compiled. +plugins/erlydtl plugins/protobuffs # Core modules, continued. @@ -28,7 +29,6 @@ plugins/ct plugins/dialyzer plugins/edoc plugins/elvis -plugins/erlydtl plugins/escript plugins/eunit plugins/relx diff --git a/core/core.mk b/core/core.mk index 6e15eeb..52a9472 100644 --- a/core/core.mk +++ b/core/core.mk @@ -76,8 +76,6 @@ endif # Core targets. -.NOTPARALLEL: - all:: deps app rel # Noop to avoid a Make warning when there's nothing to do. diff --git a/core/erlc.mk b/core/erlc.mk index 39ad574..42d0e32 100644 --- a/core/erlc.mk +++ b/core/erlc.mk @@ -45,10 +45,10 @@ ifneq ($(wildcard src/),) # Targets. ifeq ($(wildcard ebin/test),) -app:: $(PROJECT).d +app:: deps $(PROJECT).d $(verbose) $(MAKE) --no-print-directory app-build else -app:: clean $(PROJECT).d +app:: clean deps $(PROJECT).d $(verbose) $(MAKE) --no-print-directory app-build endif diff --git a/doc/src/guide/app.asciidoc b/doc/src/guide/app.asciidoc index 1320577..b2854de 100644 --- a/doc/src/guide/app.asciidoc +++ b/doc/src/guide/app.asciidoc @@ -46,13 +46,18 @@ up generating releases. ==== Application -You can build your application specifically, without -looking at handling dependencies or generating a release, -by running the following command: +You can build your application and dependencies without +generating a release by running the following command: [source,bash] $ make app +To build your application without touching dependencies +at all, you can use the `SKIP_DEPS` variable: + +[source,bash] +$ make app SKIP_DEPS=1 + This command is very useful if you have a lot of dependencies and develop on a machine with slow file access, like the Raspberry Pi and many other embedded devices. @@ -76,22 +81,21 @@ in the next chapter. ==== Release -You can generate the release, skipping the steps for building -the application and dependencies, by running the following -command: +It is not possible to build the release without at least +building the application itself, unless of course if there's +no application to begin with. + +To generate the release, `make` will generally suffice with +a normal Erlang.mk. A separate target is however available, +and will take care of building the release, after building +the application and all dependencies: [source,bash] $ make rel -This command can be useful if nothing changed except the -release configuration files. - Consult the link:relx.asciidoc[Releases] chapter for more information about what releases are and how they are generated. -Note that this command may fail if a required dependency -is missing. - === Application resource file When building your application, Erlang.mk will generate the diff --git a/plugins/relx.mk b/plugins/relx.mk index 5aa6196..a27992d 100644 --- a/plugins/relx.mk +++ b/plugins/relx.mk @@ -22,7 +22,7 @@ endif ifeq ($(IS_DEP),) ifneq ($(wildcard $(RELX_CONFIG)),) -rel:: distclean-relx-rel relx-rel +rel:: relx-rel endif endif @@ -34,7 +34,7 @@ $(RELX): $(gen_verbose) $(call core_http_get,$(RELX),$(RELX_URL)) $(verbose) chmod +x $(RELX) -relx-rel: $(RELX) rel-deps +relx-rel: $(RELX) rel-deps app $(verbose) $(RELX) -c $(RELX_CONFIG) $(RELX_OPTS) distclean-relx-rel: -- cgit v1.2.3