Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update Makefile for macosX installation about using luajit building deps #217

Merged
merged 8 commits into from
Jul 10, 2019
10 changes: 6 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ INST_LUADIR ?= $(INST_PREFIX)/share/lua/5.1
INST_BINDIR ?= /usr/bin
INSTALL ?= install
UNAME ?= $(shell uname)
OR_EXEC ?= $(shell which openresty)
LUA_JIT_DIR ?= $(shell TMP='./v_tmp' && $(OR_EXEC) -V &>$${TMP} && cat $${TMP} | grep prefix | grep -Eo 'prefix=(.*?)/nginx' | grep -Eo '/.*/' && rm $${TMP})luajit
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

'./v_tmp' -> '/tmp/v_tmp', how about this?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it doesn't make any sense, the v_tmp file will been clean immediately at the end of this command.



.PHONY: default
Expand All @@ -23,7 +25,7 @@ help:
dev:
./utils/update_nginx_conf_dev.sh
ifeq ($(UNAME),Darwin)
luarocks install --lua-dir=/usr/local/openresty/luajit apisix-*.rockspec --tree=deps --only-deps
luarocks install --lua-dir=$(LUA_JIT_DIR) apisix-*.rockspec --tree=deps --only-deps
else
sudo luarocks install --lua-dir=/usr/local/openresty/luajit apisix-*.rockspec --tree=deps --only-deps
endif
Expand Down Expand Up @@ -52,13 +54,13 @@ init:
run:
mkdir -p logs
mkdir -p /tmp/cores/
$$(which openresty) -p $$PWD/
$(OR_EXEC) -p $$PWD/
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we need to specified fully path for config file, eg: -c $$PWD/conf/nginx.conf.

image

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it may fail under Mac OSX.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed already: 5fccb78

please rebase to master.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, -c is needed under Mac OSX. I have add a travis for it, and all check passed. Let's merge it alright?



### stop: Stop the apisix server
.PHONY: stop
stop:
$$(which openresty) -p $$PWD/ -s stop
$(OR_EXEC) -p $$PWD/ -s stop


### clean: Remove generated files
Expand All @@ -70,7 +72,7 @@ clean:
### reload: Reload the apisix server
.PHONY: reload
reload:
$$(which openresty) -p $$PWD/ -s reload
$(OR_EXEC) -p $$PWD/ -s reload


### install: Install the apisix
Expand Down