-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
120 lines (100 loc) · 2.9 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
# set shell
SHELL := /usr/bin/env bash
## dirs : Setup directory structure
dirs :
mkdir -p ../{documents,downloads,misc}
mkdir -p ../documents/{gitlab,github}
## ssh : Get SSH key for easy copy-paste
ssh : ~/.ssh/id_rsa.pub
cat ~/.ssh/id_rsa.pub
## makessh : Generate local SSH key
makessh :
ssh-keygen
## conda : Install conda for Python package management
# Remove "_64" for 32-bit systems
# Rename directory from Miniconda3/ to conda/
CONDA=~/documents/miniconda.sh
conda :
curl \
-o $(CONDA) \
https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh
cd ~; bash $(CONDA)
rm $(CONDA)
## cclean : Clean conda packages and cache
# See conda clean --help for more
cclean :
conda clean --all
## archclean : Clean Arch Linux cache
# Source:
# https://www.ostechnix.com/recommended-way-clean-package-cache-arch-linux/
archclean :
sudo paccache -r
## aptclean : Clean apt-get computers
# Source:
# https://askubuntu.com/a/32224
aptclean :
sudo apt autoclean
sudo apt-get clean
sudo apt autoremove
## npmclean : Clear npm cache
# Source: https://docs.npmjs.com/cli/cache
npmclean :
sudo npm cache clean --force
sudo npm cache verify
## pipclean : Clear pip cache
# Source: https://stackoverflow.com/a/61762308/6873133
pipclean :
pip cache purge
## setup : General setup for new environments
setup :
stow vim
stow emacs
stow git
stow bash
## editors : Speed test editor start-up
# Source: https://emacs.stackexchange.com/q/39484/18898
editors :
time vim +qall
time emacs -nw -kill
time emacs -nw -q -kill
## emacs : Tangle Emacs config
emacs : ~/.emacs.d/README.org
emacs \
--batch \
--eval \
"(require 'org)" \
--eval "(org-babel-load-file \"~/.emacs.d/README.org\")"
## emacsconfig : Copy over configuration on Windows
# Windows computer setup has the configuration elsewhere and needs to be moved
# Symbolic linking didn't work.
emacsconfig :
cp ~/.emacs.d/README.org emacs/.emacs.d/README.org
## rstudio : Install RStudio config in Unix-like systems
rstudio :
cp rstudio/rstudio-prefs.json ~/.config/rstudio
## rstudio-win : Install RStudio config in Windows
rstudio-win :
cp rstudio/rstudio-prefs.json ~/AppData/Roaming/RStudio/
## vundle : Install Vundle for managing Vim packages
vundle :
git clone \
https://github.com/VundleVim/Vundle.vim.git \
~/.vim/bundle/Vundle.vim
vim +PluginInstall +qall
## ubuntu : Setup Ubuntu setup
# Setup new Ubuntu setup such as on crouton Chromebook
ubuntu : scripts/setup_ubuntu.sh
bash scripts/setup_ubuntu.sh
.PHONY : help example conda dirs vundle cclean ssh makessh setup editors emacs \
ubuntu npmclean pipclean archclean emacsconfig
## help : Help page for Makefile
help :
@echo ""
@echo "Usage:"
@echo -e "\tmake <target>\n"
@echo -e "Target Description"
@echo -e "------ -----------"
@grep '## [A-Za-z]* : [A-Za-z]*' $(MAKEFILE_LIST) | \
sed 's/## //' | \
awk -F" : " '{ printf "%-13s%s\n", $$1, $$2}'
.DEFAULT_GOAL := help