aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLoïc Hoguin <[email protected]>2013-01-29 20:29:40 +0100
committerLoïc Hoguin <[email protected]>2013-01-29 20:29:40 +0100
commit265e372fd2d5ef121df729bb15a9d90e85cb2b35 (patch)
tree95b5379c36190a3896c58e49750f003a060632a2
parenta643618a0719f00eb9fcf90f69d0334f451feca5 (diff)
downloadranch-265e372fd2d5ef121df729bb15a9d90e85cb2b35.tar.gz
ranch-265e372fd2d5ef121df729bb15a9d90e85cb2b35.tar.bz2
ranch-265e372fd2d5ef121df729bb15a9d90e85cb2b35.zip
Makefile verbosity tweaks
-rw-r--r--Makefile32
1 files changed, 20 insertions, 12 deletions
diff --git a/Makefile b/Makefile
index 321b062..a9570ad 100644
--- a/Makefile
+++ b/Makefile
@@ -6,6 +6,19 @@ ERLC_OPTS = -Werror +debug_info +warn_export_all # +bin_opt_info +warn_missing_s
DEPS_DIR ?= $(CURDIR)/deps
export DEPS_DIR
+# Makefile tweaks.
+
+V ?= 0
+
+appsrc_verbose_0 = @echo " APP " $(PROJECT).app.src;
+appsrc_verbose = $(appsrc_verbose_$(V))
+
+erlc_verbose_0 = @echo " ERLC " $(?F);
+erlc_verbose = $(erlc_verbose_$(V))
+
+gen_verbose_0 = @echo " GEN " $@;
+gen_verbose = $(gen_verbose_$(V))
+
.PHONY: all clean-all app clean docs clean-docs tests build-plt dialyze
# Application.
@@ -13,36 +26,31 @@ export DEPS_DIR
all: app
clean-all: clean clean-docs
- rm -f .$(PROJECT).plt
- rm -rf $(DEPS_DIR) logs
+ $(gen_verbose) rm -rf .$(PROJECT).plt $(DEPS_DIR) logs
MODULES = $(shell ls src/*.erl | sed 's/src\///;s/\.erl/,/' | sed '$$s/.$$//')
app: ebin/$(PROJECT).app
- @cat src/$(PROJECT).app.src \
+ $(appsrc_verbose) cat src/$(PROJECT).app.src \
| sed 's/{modules, \[\]}/{modules, \[$(MODULES)\]}/' \
> ebin/$(PROJECT).app
ebin/$(PROJECT).app: src/*.erl
@mkdir -p ebin/
- erlc -v $(ERLC_OPTS) -o ebin/ -pa ebin/ \
+ $(erlc_verbose) erlc -v $(ERLC_OPTS) -o ebin/ -pa ebin/ \
src/$(PROJECT)_transport.erl $?
clean:
- rm -rf ebin/
- rm -f test/*.beam
- rm -f erl_crash.dump
+ $(gen_verbose) rm -rf ebin/ test/*.beam erl_crash.dump
# Documentation.
docs: clean-docs
- erl -noshell -eval 'edoc:application($(PROJECT), ".", []), init:stop().'
+ $(gen_verbose) erl -noshell \
+ -eval 'edoc:application($(PROJECT), ".", []), init:stop().'
clean-docs:
- rm -f doc/*.css
- rm -f doc/*.html
- rm -f doc/*.png
- rm -f doc/edoc-info
+ $(gen_verbose) rm -f doc/*.css doc/*.html doc/*.png doc/edoc-info
# Tests.