-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMakefile
71 lines (62 loc) · 1.59 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
CURDIR ?= $(.CURDIR)
TARGET = ~
TARGETSL = ~/code/dl/sl
symlinks = bash_profile \
bashrc \
config/clipit \
config/htop \
config/openbox \
config/tint2 \
config/sxhkd \
conkyrc \
ctags \
dircolors \
emacs \
gdbinit \
gitconfig \
nvimrc \
pylintrc \
terminfo \
themes \
tmux \
tmux.conf \
vim \
vimrc \
vimrc.bundles \
xinitrc \
xmonad/xmonad.hs \
xmonad/xmobarrc \
zshrc
sllinks = dmenu \
dwm \
dvtm \
slock \
slstatus \
st \
surf \
tabbed
all:
@echo to install dotfiles to $(TARGET) run \'make install\'
install-dotfiles: $(symlinks)
install-sl: $(sllinks)
install: $(symlinks) $(sllinks)
ln -fsn $(CURDIR)/bin $(TARGET)/bin
# create symbolic link in home to dotfile
# remove link if one already exists or save file as a backup
$(symlinks):
@if [ -e $(TARGET)/.$@ ]; then \
if [ -L $(TARGET)/.$@ ]; then \
rm -f $(TARGET)/.$@; \
else \
echo mv $(TARGET)/.$@ $(TARGET)/$@-old; \
mv $(TARGET)/.$@ $(TARGET)/$@-old; \
fi \
fi
ln -sn $(CURDIR)/$@ $(TARGET)/.$@
# if suckless project is downloaded, link config header there
$(sllinks):
@if [ -e $(TARGETSL)/$@ ]; then \
echo ln -fsn $(CURDIR)/sl/$@.h $(TARGETSL)/$@/config.h; \
ln -fsn $(CURDIR)/sl/$@.h $(TARGETSL)/$@/config.h; \
fi
.PHONY: all install-dotfiles install-sl install $(symlinks) $(sllinks)