-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathMakefile
More file actions
61 lines (48 loc) · 1.38 KB
/
Makefile
File metadata and controls
61 lines (48 loc) · 1.38 KB
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
DOTIGNORE := .git .gitmodules .config
ALLFILES := $(wildcard .??*)
DOTFILES := $(filter-out $(DOTIGNORE), $(ALLFILES))
XDGFILES := $(wildcard .config/??*)
XDG_CONFIG_HOME ?= "$(HOME)/.config"
bold = @printf "\e[1m"
reset = @printf "\e[m"
_dotfiles: $(foreach file, $(DOTFILES), $(HOME)/$(file))
$(call bold)
@echo "=> Created symlink to dotfiles on \$$HOME !"
$(call reset)
$(HOME)/%: %
@ln -sv $(abspath $<) $(HOME)/$<
_xdgfiles: $(foreach file, $(XDGFILES), $(XDG_CONFIG_HOME)/$(file))
$(call bold)
@echo "=> Created symlink to dotfiles on \$$XDG_CONFIG_HOME !"
$(call reset)
$(XDG_CONFIG_HOME)/%: %
@mkdir -p $(XDG_CONFIG_HOME)
@ln -sv $(abspath $<) $(XDG_CONFIG_HOME)/$(notdir $<)
dotfiles: _dotfiles _xdgfiles
environment: dotfiles
$(call bold)
@echo "=> Downloading plugin manager..."
$(call reset)
@git submodule init
@git submodule update
$(call bold)
@echo "=> Done !"
$(call reset)
all: environment
$(call bold)
@echo "=> Install Plugins \$$HOME !"
$(call reset)
@sh env/install.sh
$(call bold)
@echo "=> Done !"
$(call reset)
clean:
@$(foreach file, $(DOTFILES), unlink $(HOME)/$(file);)
@$(foreach file, $(XDGFILES), unlink $(XDG_CONFIG_HOME)/$(notdir $(file));)
$(call bold)
@echo "=> All dotfiles has unlinked!"
$(call reset)
@echo ""
@echo "To complete cleaning up my environment, please execute"
@echo " cd \$$MDOTDIR/.."
@echo " rm -rf dotfiles"