forked from ledgetech/lua-resty-http
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
33 lines (24 loc) · 757 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
OPENRESTY_PREFIX=/usr/local/openresty
PREFIX ?= /usr/local
LUA_INCLUDE_DIR ?= $(PREFIX)/include
LUA_LIB_DIR ?= $(PREFIX)/lib/lua/$(LUA_VERSION)
INSTALL ?= install
TEST_FILE ?= t
export PATH := $(OPENRESTY_PREFIX)/nginx/sbin:$(PATH)
PROVE=TEST_NGINX_NO_SHUFFLE=1 prove -I../test-nginx/lib -r $(TEST_FILE)
# Keep in sync with .luacov, so that we show the right amount of output
LUACOV_NUM_MODULES ?= 3
.PHONY: all test install
all: ;
install: all
$(INSTALL) -d $(DESTDIR)/$(LUA_LIB_DIR)/resty
$(INSTALL) lib/resty/*.lua $(DESTDIR)/$(LUA_LIB_DIR)/resty/
test: all
$(PROVE)
coverage: all
@rm -f luacov.stats.out
TEST_COVERAGE=1 $(PROVE)
@luacov
@tail -$$(( $(LUACOV_NUM_MODULES) + 5)) luacov.report.out
check:
luacheck lib