forked from orbitalquark/textadept-lsp
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
36 lines (28 loc) · 977 Bytes
/
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
# Copyright 2018-2021 Mitchell. See LICENSE.
# Documentation.
ta = ../..
cwd = $(shell pwd)
docs: luadoc README.md
README.md: init.lua
cd $(ta)/scripts && luadoc --doclet markdowndoc $(cwd)/$< > $(cwd)/$@
sed -i -e '1,+4d' -e '6c# Language Server Protocol' -e '7d' -e 's/^##/#/;' $@
luadoc: init.lua
cd $(ta)/modules && luadoc -d $(cwd) --doclet lua/tadoc $(cwd)/$< \
--ta-home=$(shell readlink -f $(ta))
sed -i 's/_HOME.\+\?_HOME/_HOME/;' tags
# External dkjson dependency.
deps: dkjson.lua
dkjson_tgz = dkjson-2.5.tar.gz
$(dkjson_tgz): ; wget http://dkolf.de/src/dkjson-lua.fsl/tarball/$@
dkjson.lua: | $(dkjson_tgz) ; tar xzf $| && mv dkjson-*/$@ $@ && rm -r dkjson-*
# Releases.
ifneq (, $(shell hg summary 2>/dev/null))
archive = hg archive -X ".hg*" $(1)
else
archive = git archive HEAD --prefix $(1)/ | tar -xf -
endif
release: lsp | $(dkjson_tgz)
cp $| $<
make -C $< deps
zip -r $<.zip $< -x "*.gz" "$</.git*" && rm -r $<
lsp: ; $(call archive,$@)