diff options
Diffstat (limited to 'plugins')
-rw-r--r-- | plugins/c_src.mk | 2 | ||||
-rw-r--r-- | plugins/dialyzer.mk | 8 | ||||
-rw-r--r-- | plugins/relx.mk | 23 | ||||
-rw-r--r-- | plugins/shell.mk | 28 |
4 files changed, 50 insertions, 11 deletions
diff --git a/plugins/c_src.mk b/plugins/c_src.mk index 63ca6bc..2004b2d 100644 --- a/plugins/c_src.mk +++ b/plugins/c_src.mk @@ -48,7 +48,7 @@ $(C_SRC_ENV): -include $(C_SRC_ENV) else -ifneq ($(wildcard $(C_SRC_DIR),)) +ifneq ($(wildcard $(C_SRC_DIR)),) app:: $(MAKE) -C $(C_SRC_DIR) diff --git a/plugins/dialyzer.mk b/plugins/dialyzer.mk index 8e404d1..db1143a 100644 --- a/plugins/dialyzer.mk +++ b/plugins/dialyzer.mk @@ -24,11 +24,17 @@ help:: # Plugin-specific targets. -plt: deps app +$(DIALYZER_PLT): deps app @dialyzer --build_plt --apps erts kernel stdlib $(PLT_APPS) $(ALL_DEPS_DIRS) +plt: $(DIALYZER_PLT) + distclean-plt: $(gen_verbose) rm -f $(DIALYZER_PLT) +ifneq ($(wildcard $(DIALYZER_PLT)),) dialyze: +else +dialyze: $(DIALYZER_PLT) +endif @dialyzer --no_native --src -r src $(DIALYZER_OPTS) diff --git a/plugins/relx.mk b/plugins/relx.mk index ad8343f..ee226d3 100644 --- a/plugins/relx.mk +++ b/plugins/relx.mk @@ -1,14 +1,12 @@ # Copyright (c) 2013-2014, Loïc Hoguin <[email protected]> # This file is part of erlang.mk and subject to the terms of the ISC License. -.PHONY: distclean-rel +.PHONY: relx-rel distclean-relx-rel distclean-relx # Configuration. RELX_CONFIG ?= $(CURDIR)/relx.config -ifneq ($(wildcard $(RELX_CONFIG)),) - RELX ?= $(CURDIR)/relx export RELX @@ -18,14 +16,17 @@ RELX_OUTPUT_DIR ?= _rel ifeq ($(firstword $(RELX_OPTS)),-o) RELX_OUTPUT_DIR = $(word 2,$(RELX_OPTS)) +else + RELX_OPTS += -o $(RELX_OUTPUT_DIR) endif # Core targets. -rel:: distclean-rel $(RELX) - @$(RELX) -c $(RELX_CONFIG) $(RELX_OPTS) +ifneq ($(wildcard $(RELX_CONFIG)),) +rel:: distclean-relx-rel relx-rel +endif -distclean:: distclean-rel +distclean:: distclean-relx-rel distclean-relx # Plugin-specific targets. @@ -37,7 +38,11 @@ endef $(RELX): @$(call relx_fetch) -distclean-rel: - $(gen_verbose) rm -rf $(RELX) $(RELX_OUTPUT_DIR) +relx-rel: $(RELX) + @$(RELX) -c $(RELX_CONFIG) $(RELX_OPTS) + +distclean-relx-rel: + $(gen_verbose) rm -rf $(RELX_OUTPUT_DIR) -endif +distclean-relx: + $(gen_verbose) rm -rf $(RELX) diff --git a/plugins/shell.mk b/plugins/shell.mk new file mode 100644 index 0000000..9cbee2e --- /dev/null +++ b/plugins/shell.mk @@ -0,0 +1,28 @@ +# Copyright (c) 2014, M Robert Martin <[email protected]> +# This file is contributed to erlang.mk and subject to the terms of the ISC License. + +.PHONY: shell + +# Configuration. + +SHELL_PATH ?= -pa ../$(PROJECT)/ebin $(DEPS_DIR)/*/ebin +SHELL_OPTS ?= + +ALL_SHELL_DEPS_DIRS = $(addprefix $(DEPS_DIR)/,$(SHELL_DEPS)) + +# Core targets + +help:: + @printf "%s\n" "" \ + "Shell targets:" \ + " shell Run an erlang shell with SHELL_OPTS or reasonable default" + +# Plugin-specific targets. + +$(foreach dep,$(SHELL_DEPS),$(eval $(call dep_target,$(dep)))) + +build-shell-deps: $(ALL_SHELL_DEPS_DIRS) + @for dep in $(ALL_SHELL_DEPS_DIRS) ; do $(MAKE) -C $$dep ; done + +shell: build-shell-deps + $(gen_verbose) erl $(SHELL_PATH) $(SHELL_OPTS) |