summary refs log tree commit diff
path: root/Makefile
diff options
context:
space:
mode:
authorFranck Cuny <franck@lumberjaph.net>2015-07-06 11:46:36 -0700
committerFranck Cuny <franck@lumberjaph.net>2015-07-06 11:46:36 -0700
commit3d10fafdfc888b43d91aebf45cb6022f4f3c3203 (patch)
tree61bd8c8475beaa5f86f2e78d1e4d3b7ea625eb84 /Makefile
parentcreate repository (diff)
downloademacs.d-3d10fafdfc888b43d91aebf45cb6022f4f3c3203.tar.gz
configuration files
Diffstat (limited to '')
-rw-r--r--Makefile46
1 files changed, 46 insertions, 0 deletions
diff --git a/Makefile b/Makefile
new file mode 100644
index 0000000..dc4aaef
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,46 @@
+INTO    = $(HOME)
+
+INSTALL = \
+	  bash_login \
+	  bash_logout \
+	  bashrc \
+	  bin \
+	  gitconfig \
+	  gitignore \
+	  tmux.conf \
+	  vimrc
+
+git:
+	git config --local user.email "franck@lumberjaph.net"
+	git config --local user.name "Franck Cuny"
+
+INSTALLED = $(patsubst %,$(INTO)/.%,$(INSTALL))
+LN        = @ln -sf
+
+install: $(INSTALLED) $(HOME)/bin $(HOME)/src $(HOME)/tmp $(HOME)/.ssh/authorized_keys git
+
+$(INTO)/.% : %
+	@[ ! -e $@ ] || [ -h $@ ] || mv -f $@ $@.bak
+	$(LN) $(PWD)/$< $@
+
+$(HOME)/.ssh/authorized_keys:
+	$(LN) $(PWD)/ssh/authorized_keys $(HOME)/.ssh/authorized_keys
+
+$(HOME)/bin:
+	mkdir -p $(HOME)/bin
+
+$(HOME)/src:
+	mkdir -p $(HOME)/src
+
+$(HOME)/tmp:
+	mkdir -p $(HOME)/tmp
+
+check-dead:
+	@find ~ -maxdepth 1 -name '.*' -type l -exec test ! -e {} \; -print
+	@find ~/bin -maxdepth 1 -name '.*' -type l -exec test ! -e {} \; -print
+
+clean-dead:
+	@find ~ -maxdepth 1 -name '.*' -type l -exec test ! -e {} \; -delete
+	@find ~/bin -maxdepth 1 -name '.*' -type l -exec test ! -e {} \; -delete
+
+.PHONY: install check-dead clean-dead git