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-03 11:48:46 +08:00
|
|
|
### install: Install the Apisix
|
2019-05-31 21:06:55 +08:00
|
|
|
.PHONY: install
|
|
|
|
install:
|
|
|
|
$(INSTALL) -d $(INST_LUADIR)/apisix/logs/
|
|
|
|
$(INSTALL) logs/placehold.txt $(INST_LUADIR)/apisix/logs/
|
|
|
|
cp -r lua $(INST_LUADIR)/apisix/
|
|
|
|
cp -r conf $(INST_LUADIR)/apisix/
|
|
|
|
cp -r lua $(INST_LUADIR)/apisix/
|
2019-06-03 11:48:46 +08:00
|
|
|
cp -r doc $(INST_LUADIR)/apisix/
|
|
|
|
cp -r cli $(INST_LUADIR)/apisix/cli
|
2019-05-31 21:06:55 +08:00
|
|
|
chmod 644 $(INST_LUADIR)/apisix/conf/config.yaml
|
|
|
|
$(INSTALL) COPYRIGHT $(INST_LUADIR)/apisix/
|
|
|
|
$(INSTALL) README.md $(INST_LUADIR)/apisix/
|
|
|
|
$(INSTALL) README_CN.md $(INST_LUADIR)/apisix/
|
2019-06-03 11:48:46 +08:00
|
|
|
$(INSTALL) cli/apisix.lua $(INST_BINDIR)/apisix
|