forked from akornatskyy/lua-libmemcached
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
56 lines (48 loc) · 1.54 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
.SILENT: env test clean qa
.PHONY: env test clean qa
ENV=$(shell pwd)/env
LUA_IMPL=
LUA_VERSION=5.1.5
PLATFORM=macosx
LUA_ROCKS_VERSION=2.2.2
LIBMEMCACHED_DIR=/opt/local
env:
rm -rf $(ENV) ; mkdir -p $(ENV) ; \
unset LUA_PATH ; unset LUA_CPATH ; \
if [ "$(LUA_IMPL)" = "luajit" ] ; then \
wget -c http://luajit.org/download/LuaJIT-$(LUA_VERSION).tar.gz \
-O - | tar xzf - ; \
cd LuaJIT-$(LUA_VERSION) ; \
export MACOSX_DEPLOYMENT_TARGET=10.10 ; \
make -s install PREFIX=$(ENV) INSTALL_INC=$(ENV)/include ; \
ln -sf luajit-$(LUA_VERSION) $(ENV)/bin/lua ; \
cd .. ; rm -rf luajit-$(LUA_VERSION) ; \
else \
wget -c http://www.lua.org/ftp/lua-$(LUA_VERSION).tar.gz \
-O - | tar -xzf - ; \
cd lua-$(LUA_VERSION) ; \
make -s $(PLATFORM) install INSTALL_TOP=$(ENV) ; \
cd .. ; rm -rf lua-$(LUA_VERSION) ; \
fi ; \
wget -c http://luarocks.org/releases/luarocks-$(LUA_ROCKS_VERSION).tar.gz \
-O - | tar -xzf - ; \
cd luarocks-$(LUA_ROCKS_VERSION) ; \
./configure --prefix=$(ENV) --with-lua=$(ENV) --sysconfdir=$(ENV) \
--force-config && \
make -s build install && \
cd .. ; rm -rf luarocks-$(LUA_ROCKS_VERSION) ; \
for rock in busted luacov luacheck; do \
$(ENV)/bin/luarocks --deps-mode=one install $$rock ; \
done
debian:
apt-get install build-essential unzip libncurses5-dev libreadline6-dev \
libssl-dev libmemcached-dev
test:
$(ENV)/bin/busted
lib:
$(ENV)/bin/luarocks make LIBMEMCACHED_DIR=$(LIBMEMCACHED_DIR)
clean:
find src/ -name '*.o' -delete
rm -rf luacov.* luac.out *.so
qa:
$(ENV)/bin/luacheck -q src/ spec/