-
Notifications
You must be signed in to change notification settings - Fork 70
/
Makefile
30 lines (21 loc) · 731 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
OPENRESTY_PREFIX=/usr/local/openresty
PREFIX ?= /usr/local
LUA_INCLUDE_DIR ?= $(PREFIX)/include
LUA_LIB_DIR ?= $(PREFIX)/lib/lua/$(LUA_VERSION)
INSTALL ?= install
CMPFLAG = -c -fPIC
LINKFLAG = -shared
.PHONY: all test install clean
all: lib/libredis_slot.so
clean:
rm -rf lib/*.so lib/*.o
lib/redis_slot.o:lib/redis_slot.c
$(CC) $(CMPFLAG) -o $@ $^
lib/libredis_slot.so:lib/redis_slot.o
$(CC) $(LINKFLAG) -o $@ $^
install: all
$(INSTALL) -d $(DESTDIR)/$(LUA_LIB_DIR)/resty
$(INSTALL) lib/resty/*.lua $(DESTDIR)/$(LUA_LIB_DIR)/resty
$(INSTALL) lib/libredis_slot.so $(DESTDIR)/$(LUA_LIB_DIR)/libredis_slot.so
test: all
PATH=$(OPENRESTY_PREFIX)/nginx/sbin:$$PATH prove -I../test-nginx/lib -r t