forked from mSOHU/lua-bson
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
31 lines (22 loc) · 768 Bytes
/
Makefile
File metadata and controls
31 lines (22 loc) · 768 Bytes
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
LUALIB=-I/usr/local/include/luajit-2.0 -L/usr/local/bin -lluajit-5.1
LUA_INCLUDE=-I/usr/local/include/luajit-2.0
SOCKETLIB=-lws2_32
LUA_VERSION = 5.1
PREFIX ?= /usr/local
INSTALL ?= install
LUA_CMODULE_DIR = $(PREFIX)/lib/lua/$(LUA_VERSION)
.PHONY: all win linux
all :
@echo Please do \'make PLATFORM\' where PLATFORM is one of these:
@echo win linux
win: bson.dll
linux: lbitlib.a bson.so
$(INSTALL) bson.so /usr/local/lib/lua/5.1/
bson.dll : bson.c
gcc --shared -Wall -O2 $^ -o$@ $(LUALIB) $(SOCKETLIB)
lbitlib.a :
gcc -c -Wall -fPIC -Ilua-compat-5.2/c-api -O2 lua-compat-5.2/lbitlib.c -o$@ $(LUA_INCLUDE)
bson.so : bson.c
gcc --shared -Wall -fPIC -Ilua-compat-5.2/c-api -O2 $^ lbitlib.a -o$@ $(LUALIB)
clean:
rm -f bson.dll bson.so *.a