mirror of
https://github.com/ninenines/cowboy.git
synced 2025-07-14 12:20:24 +00:00
Make getting deps a function in the Makefile
This commit is contained in:
parent
68a365b85a
commit
31a7104668
1 changed files with 11 additions and 4 deletions
15
Makefile
15
Makefile
|
@ -1,13 +1,22 @@
|
||||||
# See LICENSE for licensing information.
|
# See LICENSE for licensing information.
|
||||||
|
|
||||||
PROJECT = cowboy
|
PROJECT = cowboy
|
||||||
RANCH_VSN = 0.8.1
|
|
||||||
ERLC_OPTS ?= -Werror +debug_info +warn_export_all +warn_export_vars \
|
ERLC_OPTS ?= -Werror +debug_info +warn_export_all +warn_export_vars \
|
||||||
+warn_shadow_vars +warn_obsolete_guard # +bin_opt_info +warn_missing_spec
|
+warn_shadow_vars +warn_obsolete_guard # +bin_opt_info +warn_missing_spec
|
||||||
|
|
||||||
|
# Dependencies.
|
||||||
|
|
||||||
|
dep_ranch = https://github.com/extend/ranch.git 0.8.1
|
||||||
|
|
||||||
DEPS_DIR ?= $(CURDIR)/deps
|
DEPS_DIR ?= $(CURDIR)/deps
|
||||||
export DEPS_DIR
|
export DEPS_DIR
|
||||||
|
|
||||||
|
define get_dep =
|
||||||
|
@mkdir -p $(DEPS_DIR)
|
||||||
|
git clone -n -- $(word 1,$(dep_$(1))) $(DEPS_DIR)/$(1)
|
||||||
|
cd $(DEPS_DIR)/$(1) ; git checkout -q $(word 2,$(dep_$(1)))
|
||||||
|
endef
|
||||||
|
|
||||||
# Makefile tweaks.
|
# Makefile tweaks.
|
||||||
|
|
||||||
V ?= 0
|
V ?= 0
|
||||||
|
@ -51,9 +60,7 @@ clean:
|
||||||
# Dependencies.
|
# Dependencies.
|
||||||
|
|
||||||
$(DEPS_DIR)/ranch:
|
$(DEPS_DIR)/ranch:
|
||||||
@mkdir -p $(DEPS_DIR)
|
$(call get_dep,ranch)
|
||||||
git clone -n -- https://github.com/extend/ranch.git $(DEPS_DIR)/ranch
|
|
||||||
cd $(DEPS_DIR)/ranch ; git checkout -q $(RANCH_VSN)
|
|
||||||
|
|
||||||
deps: $(DEPS_DIR)/ranch
|
deps: $(DEPS_DIR)/ranch
|
||||||
@$(MAKE) -C $(DEPS_DIR)/ranch
|
@$(MAKE) -C $(DEPS_DIR)/ranch
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue