From 31a71046681b3d992ec2ffcf210625a293f3e4ee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Hoguin?= Date: Tue, 30 Apr 2013 18:43:12 +0200 Subject: Make getting deps a function in the Makefile --- Makefile | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) (limited to 'Makefile') 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 -- cgit v1.2.3