diff options
Diffstat (limited to 'core')
-rw-r--r-- | core/core.mk | 2 | ||||
-rw-r--r-- | core/deps.mk | 30 |
2 files changed, 24 insertions, 8 deletions
diff --git a/core/core.mk b/core/core.mk index 8188bc3..6af2db9 100644 --- a/core/core.mk +++ b/core/core.mk @@ -12,7 +12,7 @@ # ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF # OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. -.PHONY: all app deps search rel docs install-docs check tests clean distclean help erlang-mk +.PHONY: all app apps deps search rel docs install-docs check tests clean distclean help erlang-mk ERLANG_MK_FILENAME := $(realpath $(lastword $(MAKEFILE_LIST))) diff --git a/core/deps.mk b/core/deps.mk index 2527c03..ac8eaaa 100644 --- a/core/deps.mk +++ b/core/deps.mk @@ -48,19 +48,35 @@ dep_verbose = $(dep_verbose_$(V)) # Core targets. -ifneq ($(SKIP_DEPS),) -deps:: +ifdef IS_APP +apps:: else -deps:: $(ALL_DEPS_DIRS) -ifndef IS_APP +apps:: $(ALL_APPS_DIRS) +ifeq ($(IS_APP)$(IS_DEP),) + $(verbose) rm -f $(ERLANG_MK_TMP)/apps.log +endif + $(verbose) mkdir -p $(ERLANG_MK_TMP) +# Create ebin directory for all apps to make sure Erlang recognizes them +# as proper OTP applications when using -include_lib. This is a temporary +# fix, a proper fix would be to compile apps/* in the right order. $(verbose) for dep in $(ALL_APPS_DIRS) ; do \ - mkdir -p $$dep/ebin; \ + mkdir -p $$dep/ebin || exit $$?; \ done $(verbose) for dep in $(ALL_APPS_DIRS) ; do \ - $(MAKE) -C $$dep IS_APP=1 || exit $$?; \ + if grep -qs ^$$dep$$ $(ERLANG_MK_TMP)/apps.log; then \ + :; \ + else \ + echo $$dep >> $(ERLANG_MK_TMP)/apps.log; \ + $(MAKE) -C $$dep IS_APP=1 || exit $$?; \ + fi \ done endif -ifneq ($(IS_DEP),1) + +ifneq ($(SKIP_DEPS),) +deps:: +else +deps:: $(ALL_DEPS_DIRS) apps +ifeq ($(IS_APP)$(IS_DEP),) $(verbose) rm -f $(ERLANG_MK_TMP)/deps.log endif $(verbose) mkdir -p $(ERLANG_MK_TMP) |