forked from p0pr0ck5/lua-resty-waf
-
Notifications
You must be signed in to change notification settings - Fork 3
/
Makefile
40 lines (29 loc) · 1.13 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
OPENRESTY_PREFIX ?= /usr/local/openresty
LUA_LIB_DIR ?= $(OPENRESTY_PREFIX)/lualib
INSTALL ?= ln -s
INSTALL_HARD = cp -r
PWD = `pwd`
LIBS = cookie.lua iputils.lua logger libinjection.lua waf waf.lua
SO_LIBS = libac.so libinjection.so
RULES = rules
.PHONY: all test install clean test-unit test-acceptance test-regression test-translate
all: ;
clean:
cd $(LUA_LIB_DIR) && rm -rf $(RULES) && rm $(SO_LIBS) && cd resty/ && rm -rf $(LIBS)
test-unit:
PATH=$(OPENRESTY_PREFIX)/nginx/sbin:$$PATH prove -r ./t/unit
test-acceptance:
PATH=$(OPENRESTY_PREFIX)/nginx/sbin:$$PATH prove -r ./t/acceptance
test-regression:
PATH=$(OPENRESTY_PREFIX)/nginx/sbin:$$PATH prove -r ./t/regression
test-translate:
prove -r ./t/translate/
test: test-unit test-acceptance test-regression test-translate
install: all
$(INSTALL) $(PWD)/lib/resty/* $(LUA_LIB_DIR)/resty/
$(INSTALL) $(PWD)/lib/*.so $(LUA_LIB_DIR)
$(INSTALL) $(PWD)/rules/ $(LUA_LIB_DIR)
install-hard: all
$(INSTALL_HARD) $(PWD)/lib/resty/* $(LUA_LIB_DIR)/resty/
$(INSTALL_HARD) $(PWD)/lib/*.so $(LUA_LIB_DIR)
$(INSTALL_HARD) $(PWD)/rules/ $(LUA_LIB_DIR)