From a4d02628a61d3721b39ca0fe8af33f4d2851fa5f Mon Sep 17 00:00:00 2001 From: 10sr <8slashes+git@gmail.com> Date: Fri, 6 Mar 2015 00:41:46 +0900 Subject: [PATCH] setup-rc basically works --- Makefile | 24 ++++++++++-------------- 1 file changed, 10 insertions(+), 14 deletions(-) diff --git a/Makefile b/Makefile index 85d5939..be8ef03 100644 --- a/Makefile +++ b/Makefile @@ -59,6 +59,8 @@ $(warning home: $(home)) localdir := $(home)/.local vardir := $(home)/.var bindir := $(localdir)/bin +directories := $(dotfiles_dir) $(home) $(localdir) $(vardir) $(bindir) \ + $(home)/.emacs.d current := $(shell date) uname := $(shell uname) @@ -105,6 +107,10 @@ check-syntax: test-syntax +$(directories): + test -d "$@" || mkdir -vp "$@" + + # System detection # ================ @@ -154,8 +160,7 @@ files_fullpath := $(files:%=$(dotfiles_dir)/%) fetch_files := $(files:%=fetch-%) .PHONY: $(fetch_files) -$(fetch_files): - mkdir -vp $(dotfiles_dir) +$(fetch_files): fetch-%: $(dotfiles_dir) curl --url $(dotfiles_url_base)/$* --output $@ @@ -212,17 +217,6 @@ ack-2.12: util_url := http://beyondgrep.com/ack-2.12-single-file -# create directories -# ------------------ - -setup_directories := $(localdir) $(vardir) $(bindir) -setup-directory: $(setup_directories) - -$(localdir) $(vardir) $(bindir): - mkdir -vp $@ - - - # darwin setup # ------------ @@ -342,13 +336,15 @@ setup-rc: $(setup_rcs) command_extract_setup_load := $(grep) -e 'SETUP_LOAD: ' | \ sed -e 's/^.*SETUP_LOAD: //' -e 's|DOTFILES_DIR|$(dotfiles_dir)|' -$(setup_rcs): setup-rc-%: $(dotfiles_dir)/% +$(setup_rcs): setup-rc-%: $(dotfiles_dir)/% $(home) cat "$<" | $(command_extract_setup_load) | tee -a "$(topfile)" setup-rc-vimrc: topfile := $(home)/.vimrc setup-rc-tmux.conf: topfile := $(home)/.tmux.conf setup-rc-emacs.el: topfile := $(home)/.emacs.d/init.el +setup-rc-emacs.el: $(home)/.emacs.d + # run # ===