forked from lewis6991/gitsigns.nvim
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
96 lines (72 loc) · 2.23 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
export PJ_ROOT=$(PWD)
FILTER ?= .*
LUA_VERSION := 5.1
TL_VERSION := 0.14.1
NEOVIM_BRANCH ?= master
DEPS_DIR := $(PWD)/deps/nvim-$(NEOVIM_BRANCH)
NVIM_DIR := $(DEPS_DIR)/neovim
LUAROCKS := $(DEPS_DIR)/luarocks/usr/bin/luarocks
LUAROCKS_TREE := $(DEPS_DIR)/luarocks/usr
LUAROCKS_LPATH := $(LUAROCKS_TREE)/share/lua/$(LUA_VERSION)
LUAROCKS_INIT := eval $$($(LUAROCKS) --tree $(LUAROCKS_TREE) path) &&
.DEFAULT_GOAL := build
$(NVIM_DIR):
@mkdir -p $(DEPS_DIR)
git clone --depth 1 https://github.com/neovim/neovim --branch $(NEOVIM_BRANCH) $@
@# disable LTO to reduce compile time
make -C $@ \
DEPS_BUILD_DIR=$(dir $(LUAROCKS_TREE)) \
CMAKE_BUILD_TYPE=RelWithDebInfo \
CMAKE_EXTRA_FLAGS='-DCI_BUILD=OFF -DENABLE_LTO=OFF'
TL := $(LUAROCKS_TREE)/bin/tl
$(TL): $(NVIM_DIR)
@mkdir -p $$(dirname $@)
$(LUAROCKS) --tree $(LUAROCKS_TREE) install tl $(TL_VERSION)
INSPECT := $(LUAROCKS_LPATH)/inspect.lua
$(INSPECT): $(NVIM_DIR)
@mkdir -p $$(dirname $@)
$(LUAROCKS) --tree $(LUAROCKS_TREE) install inspect
LUV := $(LUAROCKS_TREE)/lib/lua/$(LUA_VERSION)/luv.so
$(LUV): $(NVIM_DIR)
@mkdir -p $$(dirname $@)
$(LUAROCKS) --tree $(LUAROCKS_TREE) install luv
.PHONY: lua_deps
lua_deps: $(TL) $(INSPECT)
.PHONY: test_deps
test_deps: $(NVIM_DIR)
export VIMRUNTIME=$(NVIM_DIR)/runtime
export TEST_COLORS=1
BUSTED = $$( [ -f $(NVIM_DIR)/test/busted_runner.lua ] \
&& echo "$(NVIM_DIR)/build/bin/nvim -ll $(NVIM_DIR)/test/busted_runner.lua" \
|| echo "$(LUAROCKS_INIT) busted" )
.PHONY: test
test: $(NVIM_DIR)
$(BUSTED) -v \
--lazy \
--helper=$(PWD)/test/preload.lua \
--output test.busted.outputHandlers.nvim \
--lpath=$(NVIM_DIR)/?.lua \
--lpath=$(NVIM_DIR)/build/?.lua \
--lpath=$(NVIM_DIR)/runtime/lua/?.lua \
--lpath=$(DEPS_DIR)/?.lua \
--lpath=$(PWD)/lua/?.lua \
--filter="$(FILTER)" \
$(PWD)/test
-@stty sane
.PHONY: tl-check
tl-check: $(TL)
$(TL) check teal/*.tl teal/**/*.tl
.PHONY: tl-build
tl-build: tlconfig.lua $(TL) $(LUV)
@$(TL) build
@$(LUAROCKS_INIT) ./etc/add_comments.lua
@echo Updated lua files
.PHONY: gen_help
gen_help: $(INSPECT)
@$(LUAROCKS_INIT) ./gen_help.lua
@echo Updated help
.PHONY: build
build: tl-build gen_help
.PHONY: tl-ensure
tl-ensure: tl-build
git diff --exit-code -- lua