-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
122 lines (99 loc) · 3.41 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
VPATH := bash:git:mpv:vim
RM := @rm -fv --
LINK := @ln -vns
destdir := ~
BASH_OBJECTS := bash_aliases bash_completion bash_completion.d \
bash_functions bash_env bash_sources \
dircolors dircolors_dark dircolors_light \
fignore inputrc profile pip.conf prompt
VIM_OBJECTS := vimrc vimrc.plug vimrc.plug.local tmux.conf
GIT_OBJECTS := git_log.sh gitconfig gitconfig.local gitignore
FISH_FUNCS := kindle_comic_converter.fish pack_manga.fish rename_kepub_epub.fish \
rips_capitalize.fish zip_manga.fish zip_manga_dirs.fish get_codec.fish
BASH_TARGETS := $(BASH_OBJECTS:%=$(destdir)/.%)
VIM_TARGETS := $(VIM_OBJECTS:%=$(destdir)/.%)
GIT_TARGETS := $(GIT_OBJECTS:%=$(destdir)/.%)
FISH_FUNCS_TARGETS := $(FISH_FUNCS:%=$(destdir)/.config/fish/functions/%)
OBJECTS := $(BASH_OBJECTS) $(VIM_OBJECTS) $(GIT_OBJECTS) $(FISH_FUNCS)
TARGETS := $(BASH_TARGETS) $(VIM_TARGETS) $(GIT_TARGETS) $(FISH_TARGETS)
all: bash vim git astronvim fish_funcs
clean: clean_git clean_bash clean_vim clean_fish_funcs clean_astronvim
bash: $(BASH_OBJECTS)
$(BASH_OBJECTS): $(BASH_TARGETS)
$(BASH_TARGETS):
$(LINK) $(realpath bash/$(patsubst .%,%,$(@F))) $@
vim: $(VIM_TARGETS)
$(VIM_OBJECTS): $(VIM_TARGETS)
$(VIM_TARGETS):
$(LINK) $(realpath vim/$(patsubst .%,%,$(@F))) $@
git: $(GIT_TARGETS)
$(GIT_OBJECTS): $(GIT_TARGETS)
$(GIT_TARGETS):
$(LINK) $(realpath git/$(patsubst .%,%,$(@F))) $@
fish_funcs: $(FISH_FUNCS_TARGETS)
$(FISH_FUNCS): $(FISH_FUNCS_TARGETS)
$(FISH_FUNCS_TARGETS):
$(LINK) $(realpath fish/functions/$(patsubst .%,%,$(@F))) $@
bin: $(destdir)/bin
$(destdir)/bin:
$(LINK) $(realpath bin) $(destdir)
astronvim: $(destdir)/.config/nvim/lua/user
$(destdir)/.config/nvim/lua/user:
git clone https://github.com/AstroNvim/AstroNvim ~/.config/nvim
$(LINK) $(realpath astro_nvim) $(destdir)/.config/nvim/lua/user
clean_bash:
@echo
@echo Bash Files
@echo ==========================
$(RM) $(addprefix $(destdir)/,$(notdir $(BASH_TARGETS)))
clean_vim:
@echo
@echo Vim Files
@echo ==========================
$(RM) $(addprefix $(destdir)/,$(notdir $(VIM_TARGETS)))
clean_git:
@echo
@echo Git Files
@echo ==========================
$(RM) $(addprefix $(destdir)/,$(notdir $(GIT_TARGETS)))
clean_fish_funcs:
@echo
@echo Fish Functions
@echo ==========================
$(RM) $(addprefix $(destdir)/.config/fish/functions/,$(notdir $(FISH_FUNCS_TARGETS)))
clean_bin:
@echo
@echo Bin Directory
@echo ==========================
$(RM) $(destdir)/bin
clean_astronvim:
@echo
@echo Astro Vim Directory
@echo ==========================
$(RM) $(destdir)/.config/nvim/lua/user
help:
@echo "USAGE: make [all|bash|vim|git|clean|help]"
@echo
@echo "AUTHOR: Sang Han"
@echo
@echo "DESCRIPTION:"
@echo " Program for automating users preferred login shell enviornment."
@echo " Symbolically links the startup files located within dotfiles"
@echo " repository and links them to to users \$$HOME"
@echo
@echo "HOME DIRECTORY ${HOME}"
@echo
@echo "OPTIONS:"
@echo " all [default]"
@echo " Link everything and overwrite any files that exist"
@echo " bash"
@echo " Link bash specific dotfiles"
@echo " vim"
@echo " Link configuration files for vim"
@echo " git"
@echo " Link files to customize git"
@echo " clean"
@echo " Clean files from ${HOME}"
@echo " help"
@echo " Outputs this message and quits"
.PHONY: all bash vim git clean clean_bash clean_vim clean_git help clean_fish_funcs