2019-05-31 21:06:55 +08:00
|
|
|
INST_PREFIX ?= /usr
|
|
|
|
INST_LIBDIR ?= $(INST_PREFIX)/lib64/lua/5.1
|
|
|
|
INST_LUADIR ?= $(INST_PREFIX)/share/lua/5.1
|
2019-06-03 11:48:46 +08:00
|
|
|
INST_BINDIR ?= /usr/bin
|
2019-05-31 21:06:55 +08:00
|
|
|
INSTALL ?= install
|
2019-05-06 18:17:29 +08:00
|
|
|
|
2019-06-03 11:48:46 +08:00
|
|
|
### help: Show Makefile rules.
|
2019-05-06 18:17:29 +08:00
|
|
|
.PHONY: help
|
|
|
|
help:
|
|
|
|
@echo Makefile rules:
|
|
|
|
@echo
|
|
|
|
@grep -E '^### [-A-Za-z0-9_]+:' Makefile | sed 's/###/ /'
|
|
|
|
|
|
|
|
|
2019-06-03 11:48:46 +08:00
|
|
|
### run: Start the apisix server
|
2019-05-06 18:17:29 +08:00
|
|
|
.PHONY: run
|
|
|
|
run:
|
|
|
|
mkdir -p logs
|
|
|
|
sudo $$(which openresty) -p $$PWD/
|
|
|
|
|
|
|
|
|
2019-06-03 11:48:46 +08:00
|
|
|
### stop: Stop the apisix server
|
2019-05-06 18:17:29 +08:00
|
|
|
.PHONY: stop
|
|
|
|
stop:
|
|
|
|
sudo $$(which openresty) -p $$PWD/ -s stop
|
|
|
|
|
|
|
|
|
2019-06-03 11:48:46 +08:00
|
|
|
### clean: Remove generated files
|
2019-05-06 18:17:29 +08:00
|
|
|
.PHONY: clean
|
|
|
|
clean:
|
|
|
|
rm -rf logs/
|
|
|
|
|
|
|
|
|
2019-06-03 11:48:46 +08:00
|
|
|
### reload: Reload the apisix server
|
2019-05-06 18:17:29 +08:00
|
|
|
.PHONY: reload
|
|
|
|
reload:
|
|
|
|
sudo $$(which openresty) -p $$PWD/ -s reload
|
2019-05-31 21:06:55 +08:00
|
|
|
|
|
|
|
|
2019-06-04 10:32:14 +08:00
|
|
|
### install: Install the apisix
|
2019-05-31 21:06:55 +08:00
|
|
|
.PHONY: install
|
|
|
|
install:
|
2019-06-05 15:06:28 +08:00
|
|
|
$(INSTALL) -d /usr/local/apisix/logs/
|
|
|
|
$(INSTALL) -d /usr/local/apisix/conf/
|
|
|
|
$(INSTALL) conf/mime.types /usr/local/apisix/conf/mime.types
|
2019-06-04 21:16:23 +08:00
|
|
|
$(INSTALL) conf/config.yaml /usr/local/apisix/conf/config.yaml
|
2019-06-04 20:53:58 +08:00
|
|
|
|
2019-06-05 15:06:28 +08:00
|
|
|
$(INSTALL) -d $(INST_LUADIR)/apisix/lua/apisix/core
|
|
|
|
$(INSTALL) lua/*.lua $(INST_LUADIR)/apisix/lua/
|
|
|
|
$(INSTALL) lua/apisix/core/*.lua $(INST_LUADIR)/apisix/lua/apisix/core/
|
|
|
|
$(INSTALL) lua/apisix/*.lua $(INST_LUADIR)/apisix/lua/apisix/
|
|
|
|
|
|
|
|
$(INSTALL) -d $(INST_LUADIR)/apisix/lua/apisix/plugins/prometheus/
|
|
|
|
$(INSTALL) lua/apisix/plugins/prometheus/*.lua $(INST_LUADIR)/apisix/lua/apisix/plugins/prometheus/
|
|
|
|
|
|
|
|
$(INSTALL) -d $(INST_LUADIR)/apisix/lua/apisix/plugins
|
|
|
|
$(INSTALL) lua/apisix/plugins/*.lua $(INST_LUADIR)/apisix/lua/apisix/plugins/
|
2019-06-04 20:53:58 +08:00
|
|
|
|
2019-06-04 10:40:45 +08:00
|
|
|
$(INSTALL) COPYRIGHT $(INST_CONFDIR)/COPYRIGHT
|
|
|
|
$(INSTALL) README.md $(INST_CONFDIR)/README.md
|
2019-06-04 10:32:14 +08:00
|
|
|
$(INSTALL) bin/apisix $(INST_BINDIR)/apisix
|
2019-06-03 16:24:38 +08:00
|
|
|
|
|
|
|
test:
|
|
|
|
prove -I../test-nginx/lib -r -s t/
|