/
.Makefile.local
116 lines (95 loc) · 2.89 KB
/
.Makefile.local
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
# -*- mode: makefile; -*-
# Custom Makefile rules in complement to the default one.
UNAME := $(shell uname)
USER_EMACS_DIRECTORY = $(HOME)/.config/spacemacs
SETUP_TARGETS += bootstrap
CLEAN_TARGETS += clean-elc-settings
EMACS = emacs
EMACS_BATCH = $(EMACS) -Q -batch -f batch-byte-compile
DIRS = settings
SETTINGS_SOURCES = $(shell find settings -name '*.el')
SETTINGS_TARGETS = $(patsubst %.el,%.elc, $(SETTINGS_SOURCES))
# List of complementary packages to install on Mac OS X with Homebrew
define Darvin_PACKAGE_LIST
black
cmake
dash5
flake8
git-delta
gopls
ipython
libvterm
luarocks
prettier
rtags
shellcheck
solargraph
solidity
sqlite3
endef
define Linux_PACKAGE_LIST
# TODO
endef
define Windows_PACKAGE_LIST
# TODO
endef
define NPM_PACKAGE_LIST
bash-language-server
intelephense
vmd
endef
### General information
info-emacs:
@echo "EMACS = $(EMACS)"
@echo "EMACS_BATCH = $(EMACS_BATCH)"
@echo "DIRS = $(DIRS)"
@echo "SETTINGS_SOURCES = $(SETTINGS_SOURCES)"
@echo "SETTINGS_TARGETS = $(SETTINGS_TARGETS)"
@echo
@echo "Darvin_PACKAGE_LIST = $(shell echo $(Darvin_PACKAGE_LIST))"
@echo "Linux_PACKAGE_LIST = $(shell echo $(Linux_PACKAGE_LIST))"
@echo "Windows_PACKAGE_LIST = $(shell echo $(Windows_PACKAGE_LIST))"
### Install emacs with homebrew
install-emacs-plus:
brew tap d12frosted/emacs-plus
brew install emacs-plus --with-spacemacs-icon
brew linkapps emacs-plus
install-emacs-mac:
brew tap railwaycat/emacsmacport
brew install --cask emacs-mac-spacemacs-icon
### install spacemacs
install-spacemacs: setup-xdg
@if [ -d "$(USER_EMACS_DIRECTORY)" ]; then \
echo "=> pulling latest commits into '$(USER_EMACS_DIRECTORY)'"; \
git -C $(USER_EMACS_DIRECTORY) pull origin; \
else \
git clone https://github.com/syl20bnr/spacemacs $(USER_EMACS_DIRECTORY); \
fi
@if [ ! -e "$(HOME)/.config/emacs" ]; then \
ln -s $(USER_EMACS_DIRECTORY) ~/.config/emacs; \
fi
install-fonts-darwin:
brew tap homebrew/cask-fonts
brew install --cask font-source-code-pro font-meslo-lg-nerd-font
### Setup and install dependency packages
bootstrap: bootstrap-$(shell echo $(UNAME) | tr A-Z a-z)
bootstrap-darwin: install-fonts-darwin
@echo brew install $(shell echo $(Darvin_PACKAGE_LIST))
@echo npm install -g $(shell echo $(NPM_PACKAGE_LIST))
# NOT YET SUPPORTED
bootstrap-linux:
@echo "You MUST define properly Linux_PACKAGE_LIST in .Makefile.local"
@echo "{yum | apt | ... } install $(shell echo $(Linux_PACKAGE_LIST))"
bootstrap-windows:
@echo "You MUST define properly Windows_PACKAGE_LIST in .Makefile.local"
@echo "choco install $(shell echo $(Windows_PACKAGE_LIST))"
# https://github.com/Alloyed/lua-lsp
setup-lua:
luarocks install luacheck
### Byte compilation
compile: $(patsubst %,compile-%, $(DIRS))
compile-settings: $(SETTINGS_TARGETS)
%.elc: %.el
@echo $(EMACS_BATCH) $<
clean-elc-settings:
rm -rf $(SETTINGS_TARGETS)