summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorColin Walters <walters@verbum.org>2010-07-08 13:42:02 -0400
committerColin Walters <walters@verbum.org>2010-07-08 13:42:02 -0400
commit09c46a49094cdc77c36780841ee9db99c7241e29 (patch)
treeccf939e68410412182eaaff2a17f4bdfe3789a31
parentf2d32eba386e567e948b64bc35f4c4a589522503 (diff)
downloadhomegit-MOVED-TO-GNOME-09c46a49094cdc77c36780841ee9db99c7241e29.zip
homegit-MOVED-TO-GNOME-09c46a49094cdc77c36780841ee9db99c7241e29.tar.gz
homegit-MOVED-TO-GNOME-09c46a49094cdc77c36780841ee9db99c7241e29.tar.xz
Split up install phase
-rw-r--r--Makefile19
1 files changed, 15 insertions, 4 deletions
diff --git a/Makefile b/Makefile
index 26e2909..913468b 100644
--- a/Makefile
+++ b/Makefile
@@ -1,12 +1,23 @@
all:
-install:
+# We won't nuke people's dotfiles by default
+install: install-bin
+
+install-bin:
mkdir -p $$HOME/bin 2>/dev/null
for f in bin/*; do \
bn=$$(basename $$f); \
ln -sf $$(pwd)/bin/$$bn ~/bin; \
done
- for f in dotfiles/*; do \
- bn=$$(basename $$f); \
- ln -sf $$(pwd)/dotfiles/$$bn ~/.$$bn; \
+
+install-dotfiles:
+ @for f in dotfiles/*; do \
+ bn=$$(basename $$f); target=$$HOME/.$$bn; \
+ if test -f $$target -a '!' -L $$target; then \
+ echo "error: $$target exists; remove it to opt-in to installation, then"; \
+ echo " rerun make install-dotfiles"; \
+ else \
+ echo "Installing $$target"; \
+ ln -sf $$(pwd)/dotfiles/$$bn $$target; \
+ fi; \
done