-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
51 lines (43 loc) · 1.12 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
SHELL := /bin/bash -eou pipefail
.SILENT:
DOT_FILES = $(shell ls -p1 dot/)
CONFIG_FILES = $(shell find config -type f -print)
BIN_FILES = $(shell ls -p1 bin/)
.PHONY: all
all: uninstall-all install-dots install-bins install-configs
.PHONY: uninstall-all
uninstall-all: uninstall-dots uninstall-bins uninstall-configs
.PHONY: install-dots
install-dots: uninstall-dots
for i in $(DOT_FILES); do \
echo "Dots: Installing $$i to ~/.$$i"; \
gln -sr dot/$$i ~/.$$i; \
done
.PHONY: install-configs
install-configs: uninstall-configs
for i in $(CONFIG_FILES); do \
echo "Configs: Installing $$i to ~/.$$i"; \
mkdir -p "$(shell dirname ~/.$i)"; \
gln -sr $$i ~/.$$i; \
done
.PHONY: uninstall-dots
uninstall-dots:
for i in $(DOT_FILES); do \
rm -f ~/.$$i; \
done
.PHONY: uninstall-configs
uninstall-configs:
for i in $(CONFIG_FILES); do \
rm -f ~/.$$i; \
done
.PHONY: install-bins
install-bins: uninstall-bins
for i in $(BIN_FILES); do \
echo "Bins: Installing $$i to ~/bin/$$i"; \
gln -sr bin/$$i ~/bin/$$i; \
done
.PHONY: uninstall-bins
uninstall-bins:
for i in $(BIN_FILES); do \
rm -f ~/bin/$$i; \
done