mirror of
https://github.com/ninenines/cowboy.git
synced 2025-07-14 12:20:24 +00:00
Makefile verbosity tweaks
This commit is contained in:
parent
a59c5d6e91
commit
fd5a977a39
1 changed files with 20 additions and 12 deletions
32
Makefile
32
Makefile
|
@ -7,6 +7,19 @@ ERLC_OPTS = -Werror +debug_info +warn_export_all # +bin_opt_info +warn_missing_s
|
||||||
DEPS_DIR ?= $(CURDIR)/deps
|
DEPS_DIR ?= $(CURDIR)/deps
|
||||||
export DEPS_DIR
|
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 autobahn build-plt dialyze
|
.PHONY: all clean-all app clean docs clean-docs tests autobahn build-plt dialyze
|
||||||
|
|
||||||
# Application.
|
# Application.
|
||||||
|
@ -14,8 +27,7 @@ export DEPS_DIR
|
||||||
all: app
|
all: app
|
||||||
|
|
||||||
clean-all: clean clean-docs
|
clean-all: clean clean-docs
|
||||||
rm -f .$(PROJECT).plt
|
$(gen_verbose) rm -rf .$(PROJECT).plt $(DEPS_DIR) logs
|
||||||
rm -rf $(DEPS_DIR) logs
|
|
||||||
|
|
||||||
deps/ranch:
|
deps/ranch:
|
||||||
@mkdir -p $(DEPS_DIR)
|
@mkdir -p $(DEPS_DIR)
|
||||||
|
@ -25,32 +37,28 @@ deps/ranch:
|
||||||
MODULES = $(shell ls src/*.erl | sed 's/src\///;s/\.erl/,/' | sed '$$s/.$$//')
|
MODULES = $(shell ls src/*.erl | sed 's/src\///;s/\.erl/,/' | sed '$$s/.$$//')
|
||||||
|
|
||||||
app: deps/ranch ebin/$(PROJECT).app
|
app: deps/ranch ebin/$(PROJECT).app
|
||||||
@cat src/$(PROJECT).app.src \
|
$(appsrc_verbose) cat src/$(PROJECT).app.src \
|
||||||
| sed 's/{modules, \[\]}/{modules, \[$(MODULES)\]}/' \
|
| sed 's/{modules, \[\]}/{modules, \[$(MODULES)\]}/' \
|
||||||
> ebin/$(PROJECT).app
|
> ebin/$(PROJECT).app
|
||||||
@$(MAKE) -C $(DEPS_DIR)/ranch
|
@$(MAKE) -C $(DEPS_DIR)/ranch
|
||||||
|
|
||||||
ebin/$(PROJECT).app: src/*.erl
|
ebin/$(PROJECT).app: src/*.erl
|
||||||
@mkdir -p ebin/
|
@mkdir -p ebin/
|
||||||
erlc -v $(ERLC_OPTS) -o ebin/ -pa ebin/ \
|
$(erlc_verbose) erlc -v $(ERLC_OPTS) -o ebin/ -pa ebin/ \
|
||||||
src/$(PROJECT)_middleware.erl $?
|
src/$(PROJECT)_middleware.erl $?
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
-@$(MAKE) -C $(DEPS_DIR)/ranch clean
|
-@$(MAKE) -C $(DEPS_DIR)/ranch clean
|
||||||
rm -rf ebin/
|
$(gen_verbose) rm -rf ebin/ test/*.beam erl_crash.dump
|
||||||
rm -f test/*.beam
|
|
||||||
rm -f erl_crash.dump
|
|
||||||
|
|
||||||
# Documentation.
|
# Documentation.
|
||||||
|
|
||||||
docs: clean-docs
|
docs: clean-docs
|
||||||
erl -noshell -eval 'edoc:application($(PROJECT), ".", []), init:stop().'
|
$(gen_verbose) erl -noshell \
|
||||||
|
-eval 'edoc:application($(PROJECT), ".", []), init:stop().'
|
||||||
|
|
||||||
clean-docs:
|
clean-docs:
|
||||||
rm -f doc/*.css
|
$(gen_verbose) rm -f doc/*.css doc/*.html doc/*.png doc/edoc-info
|
||||||
rm -f doc/*.html
|
|
||||||
rm -f doc/*.png
|
|
||||||
rm -f doc/edoc-info
|
|
||||||
|
|
||||||
# Tests.
|
# Tests.
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue