-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
85 lines (72 loc) · 3.17 KB
/
Makefile
File metadata and controls
85 lines (72 loc) · 3.17 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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
# Project name
PROJECT_NAME=dotfiles
.DEFAULT_GOAL := help
.PHONY := deploy
deploy: dotfiles fishconf windot vimfiles vimdocs ## Install everything, use this one to do it all
# Ignore the dotfiles in dotfiles
# Ignore Readme and Makefile
# Fish and Vim is handled below
.PHONY := dotfiles
dotfiles: ## Install (link) the dotfiles
for file in $(shell find $(CURDIR) -maxdepth 1 ! -name alacritty.toml ! -name raspi ! -name dotfiles.code-workspace ! -name gitconfig ! -name windows ! -name tags ! -name dotfiles ! -name "config.omp.*" ! -name ".[a-zA-Z]*" ! -name "README.md" ! -name "vim" ! -name "Makefile" ! -name "assh.yml" ! -name "fish" ! -name wayfire.ini ! -name nvim ); do \
f="$$(basename $$file)"; \
ln -sfn $$file ~/.$$f; \
done
ln -f gitconfig ~/.gitconfig
ln -f ./assh.yml ~/.ssh/
ln -f ./wayfire.ini ~/.config/
mkdir -p ~/.config/alacritty
ln -f ./alacritty.toml ~/.config/alacritty
.PHONY := raspi
raspi: raspi/vimrc ## Install Raspberry Pi versions of files
ln -sf $$PWD/raspi/vimrc ~/.vimrc
.PHONY := windot
windot: ## Install windows versions of files if on Windows
if [ -d /c/Users/smartin ]; then\
cp ./windows/vimrc /c/Users/smartin/.vimrc;\
fi
if [ -d /c/Users/smartin/AppData/Local/clink ]; then\
cp windows/oh-my-posh.lua /c/Users/smartin/AppData/Local/clink;\
fi
# if [ -d /c/Users/smartin/AppData/Local/nvim ]; then\
# cp windows/init.vim /c/Users/smartin/AppData/Local/nvim;\
# fi
# Fish goes to the .config dir
.PHONY := fishconf
fishconf: ## link fish to the $HOME/.config/ directory
@echo Linking fish
mkdir -p $$HOME/.config
ln -sfn $$PWD/fish $$HOME/.config/
# Vim requires a regular directory tree, it doesn't seem to accept a file link
.PHONY := vimfiles
vimfiles: ## Copy vim files to $HOME/.vim, Warning: $HOME/.vim is deleted first!
if [ -d ~/.vim ] ;then \
rm -rf ~/.vim/ ; \
fi
mkdir -p ~/.cache/undodir
curl -fLo ~/.vim/docs/learnvim.txt --create-dirs https://raw.githubusercontent.com/dahu/LearnVim/master/doc/learnvim.txt
curl -fLo ~/.vim/autoload/plug.vim --create-dirs https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
PATH="/usr/local/bin:/sbin:/bin:/usr/bin:/usr/lib/lapack:" vim -c "PlugInstall" -c qa \; </dev/zero
.PHONY := vimdocs
vimdocs: ## Create the vim helptags
find "$(HOME)/.vim/" -type d -name doc -exec vim -u NONE -c "helptags {}" -c q \;
.PHONY := nvim
nvim: nvim/init.vim ## Create PowerShell nvim init.vim
if [ -d /c/Users/smartin/AppData/Local ]; then \
mkdir -p /c/Users/smartin/AppData/Local/nvim ; \
rm -f /c/Users/smartin/AppData/Local/nvim/init.vim ; \
cp ./nvim/init.vim /c/Users/smartin/AppData/Local/nvim/ ; \
fi
.PHONY := completions
completions: ## Install completions to the proper location
if [ -d /usr/share/bash-completion/completions ];then \
cp ./completions/* /usr/share/bash-completion/completions/ ; \
fi
.PHONY := help
.PHONY := help
help: ## List targets (default)
@echo 'Management commands for ${PROJECT_NAME}:'
@grep -E '^[a-zA-Z0-9_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | \
awk 'BEGIN {FS = ":.*?## "}; {printf " \033[36m%-30s\033[0m %s\n", $$1, $$2}'
@echo
# vim: ts=4 sw=2