1
0

init commit

This commit is contained in:
2022-11-01 23:31:14 +08:00
commit 57c2c6a22e
26 changed files with 2208 additions and 0 deletions

32
Makefile Normal file
View 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}