-.PHONY: install update
+APATH := $(realpath .)
+RPATH := $(subst $(wildcard ~/),,$(APATH))
-install:
- cp -f bashrc ~/.bashrc
- cp -f bash_aliases ~/.bash_aliases
- cp -f bash_colors ~/.bash_colors
- cp -f bash_logout ~/.bash_logout
- cp -f flexget/config.yml ~/.flexget/config.yml
- cp -f vimrc ~/.vimrc
+EXCLUDES := Makefile
+ALL := $(wildcard *)
+FILES := $(filter-out $(EXCLUDES),$(ALL))
-update:
- cp -f ~/.bashrc bashrc
- cp -f ~/.bash_aliases bash_aliases
- cp -f ~/.bash_colors bash_colors
- cp -f ~/.bash_logout bash_logout
- cp -f ~/.flexget/config.yml flexget/config.yml
- cp -f ~/.vimrc vimrc
+
+test:
+ echo $(APATH)
+ echo $(FILES);
+ echo $(RPATH)
+
+.PHONY: install $(FILES)
+install: $(FILES)
+
+$(FILES):
+ cp -r ~/.$@ $@
+ rm -r ~/.$@
+ ln -sf $(RPATH)/$@ ~/.$@