]> git.rmz.io Git - dotfiles.git/blob - Makefile
64e9b73113b34a5ee1fccdd245a73c1398b0deab
[dotfiles.git] / Makefile
1 APATH := $(realpath .)
2 RPATH := $(subst $(wildcard ~/),,$(APATH))
3
4 FILES := bin
5 DOTFILES := bash* flexget vim*
6
7 .PHONY: install $(FILES) $(DOTFILES)
8 install: $(FILES) $(DOTFILES)
9
10 $(FILES):
11 @if [[ -e ~/$@ && ! -L ~/$@ ]]; then \
12 if [[ -d $@ ]]; then \
13 cp -r ~/$@/* $@; \
14 else \
15 cp -r ~/$@ $@; \
16 fi; \
17 rm -r ~/$@; \
18 fi;
19 ln -sfT $(RPATH)/$@ ~/$@
20
21 $(DOTFILES):
22 @if [[ -e ~/.$@ && ! -L ~/.$@ ]]; then \
23 if [[ -d .$@ ]]; then \
24 cp -r ~/.$@/* $@; \
25 else \
26 cp -r ~/.$@ $@; \
27 fi; \
28 rm -r ~/.$@; \
29 fi;
30 ln -sfT $(RPATH)/$@ ~/.$@