-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
49 lines (37 loc) · 1.32 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
#Install dotfiles in $HOME dir
DIR =
DOT_DIR = fonts mpd ncmpcpp vim
DOT_FILE = xsessionrc Xmodmap_t61 xinitrc Xdefaults xbindkeysrc unburden-home-dir.list screenrc profile obnam.conf mpdconf inputrc hgrc gitconfig fehbg bashrc bash_profile ackrc
all: install
install: install-ssh install-awesome \
$(foreach f, $(DIR), install-dir-$(f)) \
$(foreach f, $(DOT_DIR), install-dotdir-$(f)) \
$(foreach f, $(DOT_FILE), install-file-$(f))
install-ssh:
@echo " MKDIR Creating ~/.ssh"
@mkdir $(HOME)/.ssh 2>/dev/null
@ln -snf $(CURDIR)/ssh/config $(HOME)/.ssh/config
install-awesome:
@echo " LN ~/.config/awesome"
@ln -snf $(CURDIR)/config/awesome $(HOME)/.config/awesome
install-dir-%: %
@echo " LN $< to ~/$<"
@ln -snf $(CURDIR)/$< $(HOME)/$<
install-dotdir-%: %
@echo " LN $< to ~/.$<"
@ln -snf $(CURDIR)/$< $(HOME)/.$<
install-file-%: %
@echo " LN $< to ~/.$<"
@ln -sf $(CURDIR)/$< $(HOME)/.$<
clean: $(foreach f, $(DIR), clean-$(f)) \
$(foreach f, $(DOT_DIR), clean-.$(f)) \
$(foreach f, $(DOT_FILE), clean-.$(f))
clean-%:
@echo " CLEAN ~/$*"
@sh -c "if [ -h ~/$* ]; then rm ~/$*; fi"
clean-ssh:
@echo " CLEAN ~/.ssh/config"
@sh -c "if [ -h ~/.ssh/config ]; then rm ~/.ssh/config; fi"
clean-awesome:
@echo " CLEAN ~/.config/awesome"
@sh -c "if [ -h ~/.config/awesome ]; then rm ~/.config/awesome fi"