aboutsummaryrefslogtreecommitdiffstats
path: root/Makefile
diff options
context:
space:
mode:
authorLoïc Hoguin <[email protected]>2013-04-30 18:43:12 +0200
committerLoïc Hoguin <[email protected]>2013-04-30 18:50:36 +0200
commit31a71046681b3d992ec2ffcf210625a293f3e4ee (patch)
treefda1209e574b50c603c3ec7746c230d89a0dc96a /Makefile
parent68a365b85ad90cfba8755dcaa9aa6d9c8aecf800 (diff)
downloadcowboy-31a71046681b3d992ec2ffcf210625a293f3e4ee.tar.gz
cowboy-31a71046681b3d992ec2ffcf210625a293f3e4ee.tar.bz2
cowboy-31a71046681b3d992ec2ffcf210625a293f3e4ee.zip
Make getting deps a function in the Makefile
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