Permalink
Browse files

Makefile verbosity tweaks

  • Loading branch information...
1 parent a643618 commit 265e372fd2d5ef121df729bb15a9d90e85cb2b35 @essen essen committed Jan 29, 2013
Showing with 20 additions and 12 deletions.
  1. +20 −12 Makefile
View
@@ -6,43 +6,51 @@ 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.
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.

0 comments on commit 265e372

Please sign in to comment.