aboutsummaryrefslogtreecommitdiffstats
path: root/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile15
1 files changed, 11 insertions, 4 deletions
diff --git a/Makefile b/Makefile
index 08adaa8..97fb8ff 100644
--- a/Makefile
+++ b/Makefile
@@ -1,13 +1,22 @@
# See LICENSE for licensing information.
PROJECT = cowboy
-RANCH_VSN = 0.8.1
ERLC_OPTS ?= -Werror +debug_info +warn_export_all +warn_export_vars \
+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
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.
V ?= 0
@@ -51,9 +60,7 @@ clean:
# Dependencies.
$(DEPS_DIR)/ranch:
- @mkdir -p $(DEPS_DIR)
- git clone -n -- https://github.com/extend/ranch.git $(DEPS_DIR)/ranch
- cd $(DEPS_DIR)/ranch ; git checkout -q $(RANCH_VSN)
+ $(call get_dep,ranch)
deps: $(DEPS_DIR)/ranch
@$(MAKE) -C $(DEPS_DIR)/ranch