]> git.rmz.io Git - dotfiles.git/commitdiff
finish makefile
authorSamir Benmendil <samir.benmendil@gmail.com>
Tue, 23 Oct 2012 18:13:35 +0000 (20:13 +0200)
committerSamir Benmendil <samir.benmendil@gmail.com>
Tue, 23 Oct 2012 18:13:35 +0000 (20:13 +0200)
Makefile

index af701e095a06f1a683e04e6dd305e715ba3a18a1..1e63778452555e8a3008f374d82607a0d1381f93 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -1,17 +1,20 @@
-.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)/$@ ~/.$@