forked from lewis6991/gitsigns.nvim
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
91 lines (69 loc) · 1.96 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
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 := luarocks --lua-version=$(LUA_VERSION)
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=-DENABLE_LTO=OFF
TL := $(LUAROCKS_TREE)/bin/tl
$(TL):
@mkdir -p $@
$(LUAROCKS) --tree $(LUAROCKS_TREE) install tl $(TL_VERSION)
INSPECT := $(LUAROCKS_LPATH)/inspect.lua
$(INSPECT):
@mkdir -p $@
$(LUAROCKS) --tree $(LUAROCKS_TREE) install inspect
.PHONY: lua_deps
lua_deps: $(TL) $(INSPECT)
.PHONY: test_deps
test_deps: $(NVIM_DIR)
export VIMRUNTIME=$(NVIM_DIR)/runtime
export TEST_COLORS=1
ifneq ($(filter $(NEOVIM_BRANCH), master nightly),)
BUSTED = $(NVIM_DIR)/build/bin/nvim -ll $(NVIM_DIR)/test/busted_runner.lua
else
BUSTED = $(LUAROCKS_INIT) busted
endif
.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)
@$(TL) build
@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