mirror of
https://github.com/ninenines/cowboy.git
synced 2025-07-14 12:20:24 +00:00
Add recursive dependency fetching to the Makefile
Also small other changes like how we build the PLT.
This commit is contained in:
parent
305e639fef
commit
563e7d91ce
1 changed files with 16 additions and 12 deletions
28
Makefile
28
Makefile
|
@ -4,6 +4,9 @@ PROJECT = cowboy
|
||||||
RANCH_VSN = 0.6.0
|
RANCH_VSN = 0.6.0
|
||||||
ERLC_OPTS = -Werror +debug_info +warn_export_all # +bin_opt_info +warn_missing_spec
|
ERLC_OPTS = -Werror +debug_info +warn_export_all # +bin_opt_info +warn_missing_spec
|
||||||
|
|
||||||
|
DEPS_DIR ?= $(CURDIR)/deps
|
||||||
|
export DEPS_DIR
|
||||||
|
|
||||||
.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.
|
||||||
|
@ -12,25 +15,26 @@ all: app
|
||||||
|
|
||||||
clean-all: clean clean-docs
|
clean-all: clean clean-docs
|
||||||
rm -f .$(PROJECT).plt
|
rm -f .$(PROJECT).plt
|
||||||
rm -rf deps logs
|
rm -rf $(DEPS_DIR) logs
|
||||||
|
|
||||||
deps/ranch:
|
deps/ranch:
|
||||||
@mkdir -p deps/
|
@mkdir -p $(DEPS_DIR)
|
||||||
git clone -n -- https://github.com/extend/ranch.git deps/ranch
|
git clone -n -- https://github.com/extend/ranch.git $(DEPS_DIR)/ranch
|
||||||
cd deps/ranch ; git checkout -q $(RANCH_VSN)
|
cd $(DEPS_DIR)/ranch ; git checkout -q $(RANCH_VSN)
|
||||||
|
|
||||||
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
|
app: deps/ranch
|
||||||
@cd deps/ranch ; make
|
@$(MAKE) -C $(DEPS_DIR)/ranch
|
||||||
@mkdir -p ebin/
|
@mkdir -p ebin/
|
||||||
@cat src/cowboy.app.src \
|
@cat src/$(PROJECT).app.src \
|
||||||
| sed 's/{modules, \[\]}/{modules, \[$(MODULES)\]}/' \
|
| sed 's/{modules, \[\]}/{modules, \[$(MODULES)\]}/' \
|
||||||
> ebin/cowboy.app
|
> ebin/$(PROJECT).app
|
||||||
erlc -v $(ERLC_OPTS) -o ebin/ -pa ebin/ src/cowboy_middleware.erl src/*.erl
|
erlc -v $(ERLC_OPTS) -o ebin/ -pa ebin/ \
|
||||||
|
src/$(PROJECT)_middleware.erl src/*.erl
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
-@cd deps/ranch && make clean
|
-@$(MAKE) -C $(DEPS_DIR)/ranch clean
|
||||||
rm -rf ebin/
|
rm -rf ebin/
|
||||||
rm -f test/*.beam
|
rm -f test/*.beam
|
||||||
rm -f erl_crash.dump
|
rm -f erl_crash.dump
|
||||||
|
@ -38,7 +42,7 @@ clean:
|
||||||
# Documentation.
|
# Documentation.
|
||||||
|
|
||||||
docs: clean-docs
|
docs: clean-docs
|
||||||
erl -noshell -eval 'edoc:application(cowboy, ".", []), init:stop().'
|
erl -noshell -eval 'edoc:application($(PROJECT), ".", []), init:stop().'
|
||||||
|
|
||||||
clean-docs:
|
clean-docs:
|
||||||
rm -f doc/*.css
|
rm -f doc/*.css
|
||||||
|
@ -49,7 +53,7 @@ clean-docs:
|
||||||
# Tests.
|
# Tests.
|
||||||
|
|
||||||
CT_RUN = ct_run \
|
CT_RUN = ct_run \
|
||||||
-pa ebin deps/*/ebin \
|
-pa ebin $(DEPS_DIR)/*/ebin \
|
||||||
-dir test \
|
-dir test \
|
||||||
-logdir logs \
|
-logdir logs \
|
||||||
-cover test/cover.spec
|
-cover test/cover.spec
|
||||||
|
@ -67,7 +71,7 @@ autobahn: clean app
|
||||||
|
|
||||||
build-plt: app
|
build-plt: app
|
||||||
@dialyzer --build_plt --output_plt .$(PROJECT).plt \
|
@dialyzer --build_plt --output_plt .$(PROJECT).plt \
|
||||||
--apps erts kernel stdlib sasl inets crypto public_key ssl deps/ranch
|
--apps erts kernel stdlib crypto public_key ssl $(DEPS_DIR)/ranch
|
||||||
|
|
||||||
dialyze:
|
dialyze:
|
||||||
@dialyzer --src src --plt .$(PROJECT).plt --no_native \
|
@dialyzer --src src --plt .$(PROJECT).plt --no_native \
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue