-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathMakefile
136 lines (104 loc) · 3.79 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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
XDG_HOME ?= $(HOME)/.config
HOME_DIRS = \
. \
.emacs.d \
.emacs.d/eshell \
.gnupg \
.local/share/applications \
.tmux \
.xmonad
XDG_HOME_DIRS = \
alacritty \
compton \
dunst \
git \
guix \
lynx \
shepherd \
zathura
DIRS = \
$(foreach dir,$(HOME_DIRS),$(HOME)/$(dir)) \
$(foreach dir,$(XDG_HOME_DIRS),$(XDG_HOME)/$(dir))
SYMLINKS = \
$(HOME)/.emacs.d/init.el \
$(HOME)/.emacs.d/feeds \
$(HOME)/.emacs.d/eshell/alias \
$(XDG_HOME)/mimeapps.list \
$(HOME)/.local/share/applications/mimeapps.list \
$(XDG_HOME)/alacritty/alacritty.toml \
$(HOME)/.bashrc \
$(HOME)/.bash_profile \
$(XDG_HOME)/compton/compton.conf \
$(XDG_HOME)/dunst/dunstrc \
$(HOME)/.ghci \
$(HOME)/.gnupg/gnupg.conf \
$(HOME)/.gnus \
$(HOME)/.guile \
$(HOME)/.haskeline \
$(XDG_HOME)/git/config \
$(XDG_HOME)/guix/channels.scm \
$(XDG_HOME)/lynx/lynx.cfg \
$(HOME)/.psqlrc \
$(HOME)/.inputrc \
$(XDG_HOME)/shepherd/init.scm \
$(HOME)/.tmux.conf \
$(HOME)/.xsession \
$(XDG_HOME)/zathura/zathurarc
ln = ln -s
# ----------- top level commands -------------
.PHONY: install
install: | $(SYMLINKS) ## Install $(SYMLINKS) to $HOME (default)
.PHONY: help
help:
@grep -E '^[a-zA-Z_()$$. /-]+:.*?## .*$$' Makefile | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'
# ------------ softlinks -------------
$(HOME)/.emacs.d/init.el: | $(HOME)/.emacs.d ## Emacs initialization file
$(ln) $(PWD)/emacs/init.el $@
$(HOME)/.emacs.d/feeds: | $(HOME)/.emacs.d ## subscriptions for elfeed
$(ln) $(PWD)/rss $@
$(HOME)/.emacs.d/eshell/alias: | $(HOME)/.emacs.d/eshell
$(ln) $(PWD)/emacs/eshell/alias $@
$(XDG_HOME)/mimeapps.list: | $(XDG_HOME) ## Default mime handlers
$(ln) $(PWD)/xdg/mimeapps.list $@
$(HOME)/.local/share/applications/mimeapps.list: | $(XDG_HOME)/mimeapps.list $(HOME)/.local/share/applications ## Default mime handlers
$(ln) $(XDG_HOME)/mimeapps.list $@
$(XDG_HOME)/alacritty/alacritty.toml: | $(XDG_HOME)/alacritty ## Alacritty configuration
$(ln) $(PWD)/alacritty/alacritty.toml $@
$(HOME)/.bashrc: | $(HOME) ## Bash configuration (per shell)
$(ln) $(PWD)/bash/.bashrc $@
$(HOME)/.bash_profile: | $(HOME) ## Bash configuration (per session)
$(ln) $(PWD)/bash/.bash_profile $@
$(XDG_HOME)/compton/compton.conf: | $(XDG_HOME)/compton ## Compton configuration
$(ln) $(PWD)/compton/compton.conf $@
$(XDG_HOME)/dunst/dunstrc: | $(XDG_HOME)/dunst ## Dunst configuration
$(ln) $(PWD)/dunst/dunstrc $@
$(HOME)/.ghci: | $(HOME) ## ghci configuration
$(ln) $(PWD)/ghci/.ghci $@
$(HOME)/.gnupg/gnupg.conf: | $(HOME)/.gnupg ## gnupg configuration
$(ln) $(PWD)/gnupg/gnupg.conf $@
$(HOME)/.gnus: | $(HOME) ## Gnus configuration
$(ln) $(PWD)/emacs/.gnus $@
$(HOME)/.guile: | $(HOME) ## Guile configuration
$(ln) $(PWD)/guile/.guile $@
$(HOME)/.haskeline: | $(HOME) ## haskeline configuration (for ghci)
$(ln) $(PWD)/ghci/.haskeline $@
$(XDG_HOME)/git/config: | $(XDG_HOME)/git ## Git configuration
$(ln) $(PWD)/git/.gitconfig $@
$(XDG_HOME)/guix/channels.scm: | $(XDG_HOME)/guix ## Guix channel specification
$(ln) $(PWD)/guix/channels.scm $@
$(XDG_HOME)/lynx/lynx.cfg: | $(XDG_HOME)/lynx ## Lynx configuration
$(ln) $(PWD)/lynx/lynx.cfg $@
$(HOME)/.psqlrc: | $(HOME) ## psql configuration
$(ln) $(PWD)/psql/.psqlrc $@
$(HOME)/.inputrc: | $(HOME) ## readline configuration
$(ln) $(PWD)/readline/.inputrc $@
$(XDG_HOME)/shepherd/init.scm: | $(XDG_HOME)/shepherd ## User shepherd configuration and services
$(ln) $(PWD)/shepherd/init.scm $@
$(HOME)/.tmux.conf: | $(HOME) ## Tmux configuration
$(ln) $(PWD)/tmux/.tmux.conf $@
$(HOME)/.xsession: | $(HOME) ## Loaded by gdm and other DMs on login
$(ln) $(PWD)/xmonad/.xsession $@
$(XDG_HOME)/zathura/zathurarc: | $(XDG_HOME)/zathura ## Zathura configuration
$(ln) $(PWD)/zathura/zathurarc $@
$(DIRS): ## Make sure containing directories exist
mkdir -p $@