From 7668e945e21a425057323fad479bb5c4fc969f60 Mon Sep 17 00:00:00 2001 From: 10sr <8slashes+git@gmail.com> Date: Mon, 26 Jan 2015 00:49:18 +0900 Subject: [PATCH] Add file targets --- Makefile | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 5cf84f5..64b0b30 100644 --- a/Makefile +++ b/Makefile @@ -5,9 +5,10 @@ home ?= $(HOME) -dotfiles_url_base := https://raw.githubusercontent.com/10sr/dotfiles/master/ +dotfiles_url_base := https://raw.githubusercontent.com/10sr/dotfiles/master dotfiles_git := git@github.com:10sr/dotfiles.git dotfiles_git_pub := http://github.com/10sr/dotfiles.git +use_git ?= t ifeq (,$(dotfiles_dir)) ifeq (,$(DOTFILES_DIR)) @@ -107,6 +108,22 @@ endif +# preparing files +# =============== + +ifeq (,$(use_git)) +$(warning 'use_git' is set to empty. Use curl to fetch files) +$(dotfiles_dir)/%: + mkdir -vp $(dotfiles_dir) + curl --url $(dotfiles_url_base)/$* --output $@ +else +$(warning 'use_git' is set to non-empty. Use git to fetch files) +$(dotfiles_dir)/%: $(dotfiles_dir)/.git + test -f "$@" +endif + + + # setups # ======