aboutsummaryrefslogtreecommitdiffstats
path: root/core/erlc.mk
diff options
context:
space:
mode:
authorJean-Sébastien Pédron <[email protected]>2015-09-03 14:25:08 +0200
committerJean-Sébastien Pédron <[email protected]>2015-09-03 14:41:22 +0200
commit79de1365398a3b38d7b56f61f181af04b5973496 (patch)
treedad1551498a9f8d6a425000eb4b1db05db7ed7b4 /core/erlc.mk
parentabcc53a0420ce170169addb143afe20b756db913 (diff)
downloaderlang.mk-79de1365398a3b38d7b56f61f181af04b5973496.tar.gz
erlang.mk-79de1365398a3b38d7b56f61f181af04b5973496.tar.bz2
erlang.mk-79de1365398a3b38d7b56f61f181af04b5973496.zip
Generate `$(PROJECT).d` before calling `make app-build`
This ensures all generated dependencies are prepared and the .d file is ready before the actual build is started.
Diffstat (limited to 'core/erlc.mk')
-rw-r--r--core/erlc.mk13
1 files changed, 8 insertions, 5 deletions
diff --git a/core/erlc.mk b/core/erlc.mk
index c92a350..e540f38 100644
--- a/core/erlc.mk
+++ b/core/erlc.mk
@@ -43,10 +43,10 @@ mib_verbose = $(mib_verbose_$(V))
# Targets.
ifeq ($(wildcard ebin/test),)
-app::
+app:: $(PROJECT).d
$(verbose) $(MAKE) --no-print-directory app-build
else
-app:: clean
+app:: clean $(PROJECT).d
$(verbose) $(MAKE) --no-print-directory app-build
endif
@@ -75,7 +75,7 @@ define app_file
endef
endif
-app-build: ebin/$(PROJECT).app
+app-build: ebin/$(PROJECT).app ; @echo -n
# Source files.
@@ -164,7 +164,10 @@ define makedep.erl
({attribute, _, file, {Dep, _}}, Acc) -> AddHd(Dep, Acc);
(_, Acc) -> Acc
end, [], Forms)),
- [F, ":", [[" ", D] || D <- Deps], "; touch \$$@\n", CompileFirst(Deps)];
+ case Deps of
+ [] -> "";
+ _ -> [F, "::", [[" ", D] || D <- Deps], "; @touch \$$@\n", CompileFirst(Deps)]
+ end;
{error, enoent} ->
[]
end
@@ -176,7 +179,7 @@ endef
$(PROJECT).d:: $(ERL_FILES) $(call core_find,include/,*.hrl)
$(makedep_verbose) $(call erlang,$(call makedep.erl,$@))
-include $(PROJECT).d
+-include $(PROJECT).d
ebin/$(PROJECT).app:: ebin/