summaryrefslogtreecommitdiffstats
path: root/Makefile
blob: 913468bbf0a56023feff7112ea4517ea6c18db28 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
all:

# 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

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