forked from abiliojr/sqlite-lua
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
executable file
·25 lines (18 loc) · 831 Bytes
/
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
# To build this on FreeBSD install lua5.3 (or similar) and sqlite3
#
# on Linux you must install:
# liblua5.3-dev or similar
# libsqlite3-dev or similar
LUA_VERSION=5.3
# next 3 lines where tested on FreeBSD and Ubuntu
LUA_CFLAGS=`pkg-config --cflags --silence-errors lua$(LUA_VERSION) || pkg-config --cflags --silence-errors lua-$(LUA_VERSION) || pkg-config --cflags --silence-errors lua`
LUA_LIB=`pkg-config --libs --silence-errors lua$(LUA_VERSION) || pkg-config --libs --silence-errors lua-$(LUA_VERSION) || pkg-config --libs --silence-errors lua`
SQLITE_FLAGS=`pkg-config --cflags --silence-errors sqlite3`
all: lua.so
lua.so: lua.o
cc -shared -o lua.so lua.o $(LUA_LIB)
@[ "`uname -s`" == "Darwin" ] && mv lua.so lua.dylib || :
lua.o: src/lua.c
cc -c $(LUA_CFLAGS) $(SQLITE_FLAGS) -O3 src/lua.c
clean:
rm lua.o