]> git.rmz.io Git - dotfiles.git/commitdiff
finally working makefile
authorSamir Benmendil <samir.benmendil@gmail.com>
Tue, 23 Oct 2012 19:48:41 +0000 (21:48 +0200)
committerSamir Benmendil <samir.benmendil@gmail.com>
Tue, 23 Oct 2012 19:48:41 +0000 (21:48 +0200)
Makefile
flexget/.gitignore [new file with mode: 0644]

index a5116c4e341252ea80c2eb8bd7782c69472a5bfa..51eeb965237744da3386393532590225108e3a0a 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -1,14 +1,30 @@
 APATH := $(realpath .)
 RPATH := $(subst $(wildcard ~/),,$(APATH))
 
-EXCLUDES := Makefile 
-ALL := $(wildcard *)
-FILES := $(filter-out $(EXCLUDES),$(ALL))
+FILES :=
+DOTFILES := bash* flexget vimrc
 
-.PHONY: install $(FILES)
-install: $(FILES)
+.PHONY: install $(FILES) $(DOTFILES)
+install: $(FILES) $(DOTFILES)
 
 $(FILES): 
-       cp -r ~/.$@ $@
-       rm -r ~/.$@
+       if [[ -f ~/$@ || -d ~/$@ ]]; then \
+         if [[ -d $@ ]]; then \
+           cp -rf ~/$@/* $@; \
+         else \
+           cp -rf ~/$@ $@; \
+         fi; \
+         rm -r ~/$@; \
+       fi; 
+       ln -sf $(RPATH)/$@ ~/.$@ 
+
+$(DOTFILES): 
+       if [[ -f ~/.$@ || -d ~/.$@ ]]; then \
+         if [[ -d $@ ]]; then \
+           cp -rf ~/.$@/* $@; \
+         else \
+           cp -rf ~/.$@ $@; \
+         fi; \
+         rm -r ~/.$@; \
+       fi; 
        ln -sf $(RPATH)/$@ ~/.$@ 
diff --git a/flexget/.gitignore b/flexget/.gitignore
new file mode 100644 (file)
index 0000000..9625a75
--- /dev/null
@@ -0,0 +1,4 @@
+db-config.sqlite
+flexget.log*
+received/
+temp/