forked from Kong/lua-resty-dns-client
-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathMakefile
More file actions
40 lines (30 loc) · 1.01 KB
/
Copy pathMakefile
File metadata and controls
40 lines (30 loc) · 1.01 KB
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
OR_EXEC ?= $(shell which openresty)
LUAROCKS_VER ?= $(shell luarocks --version | grep -E -o "luarocks [0-9]+.")
LUAJIT_DIR ?= $(shell ${OR_EXEC} -V 2>&1 | grep prefix | grep -Eo 'prefix=(.*)/nginx\s+--' | grep -Eo '/.*/')luajit
### test: Run test suite
.PHONY: test
test: lint
prove -I. -r -s t/
busted
### install: Install the library to runtime
.PHONY: install
install:
luarocks install rockspec/api7-lua-resty-dns-client-master-0.rockspec
### deps: Installation dependencies
.PHONY: deps
deps:
ifneq ($(LUAROCKS_VER),luarocks 3.)
luarocks install rockspec/api7-lua-resty-dns-client-master-0.rockspec --tree=deps --only-deps --local
else
luarocks install --lua-dir=$(LUAJIT_DIR) rockspec/api7-lua-resty-dns-client-master-0.rockspec --tree=deps --only-deps --local
endif
### lint: Lint Lua source code
.PHONY: lint
lint:
luacheck -q src
### help: Show Makefile rules
.PHONY: help
help:
@echo Makefile rules:
@echo
@grep -E '^### [-A-Za-z0-9_]+:' Makefile | sed 's/###/ /'