init commit
This commit is contained in:
32
Makefile
Normal file
32
Makefile
Normal file
@@ -0,0 +1,32 @@
|
||||
TARGET = envoy-apisix
|
||||
LUA_VERSION = 2.1.0-beta3
|
||||
|
||||
SRCS = $(wildcard envoy/*.cpp)
|
||||
OBJS = $(SRCS:.cpp=.o)
|
||||
|
||||
INCLUDES = -I./luajit/include/luajit-2.1
|
||||
CXXFLAGS = -fPIC -O2 -Wall -std=c++11 $(INCLUDES)
|
||||
LDFLAGS = -L./luajit/lib -lluajit-5.1 -ldl
|
||||
|
||||
.PHONY: all
|
||||
all: run
|
||||
|
||||
$(TARGET): $(OBJS)
|
||||
$(CXX) -o $@ $^ $(LDFLAGS)
|
||||
|
||||
luajit:
|
||||
$(RM) -r /tmp/LuaJIT-$(LUA_VERSION)
|
||||
curl -sL https://luajit.org/download/LuaJIT-$(LUA_VERSION).tar.gz | tar zxf - -C /tmp
|
||||
make -C /tmp/LuaJIT-$(LUA_VERSION) install PREFIX=$(shell pwd)/luajit XCFLAGS=-DLUAJIT_ENABLE_LUA52COMPAT
|
||||
|
||||
.PHONY: run
|
||||
run: ${TARGET}
|
||||
@./$(TARGET) ./plugins/entry.lua
|
||||
|
||||
.PHONY: envoy
|
||||
envoy:
|
||||
docker run -it --rm --net host -v $(shell pwd):/etc/envoy -e "LUA_PATH=/etc/envoy/?.lua" envoyproxy/envoy-distroless:v1.24.0
|
||||
|
||||
.PHONY: clean
|
||||
clean:
|
||||
${RM} ${TARGET} ${OBJS}
|
||||
Reference in New Issue
Block a user