2004-11-08 15:55:23 +00:00
|
|
|
#T= mysql
|
|
|
|
T= postgres
|
|
|
|
#T= oci8
|
|
|
|
#T= odbc
|
|
|
|
#T= sqlite
|
|
|
|
|
2004-11-09 13:15:17 +00:00
|
|
|
LUA_LIB_DIR= /usr/local/lib/lua/5.0
|
2004-11-08 15:55:23 +00:00
|
|
|
#LIB_EXT= .so
|
|
|
|
LIB_EXT= .dylib
|
|
|
|
#LIB_OPTION= -shared
|
|
|
|
LIB_OPTION= -dynamiclib
|
|
|
|
COMPAT_DIR= ../compat
|
|
|
|
|
2004-12-22 14:21:50 +00:00
|
|
|
VERSION= 2.0b3
|
2003-04-07 13:41:29 +00:00
|
|
|
|
2004-11-08 15:55:23 +00:00
|
|
|
OBJS= compat-5.1.o luasql.o ls_$T.o
|
|
|
|
LIBNAME= lib$T.$(VERSION)$(LIB_EXT)
|
|
|
|
LOADLIB= $T$(LIB_EXT)
|
|
|
|
|
|
|
|
# Driver specific
|
|
|
|
# SQLite
|
|
|
|
#DRIVER_LIBS= -lsqlite
|
|
|
|
#DRIVER_INCS=
|
|
|
|
|
|
|
|
# PostgreSQL
|
|
|
|
DRIVER_LIBS= -L/usr/local/pgsql/lib -lpq
|
|
|
|
DRIVER_INCS= -I/usr/local/pgsql/include
|
|
|
|
|
|
|
|
# Oracle OCI8
|
|
|
|
#DRIVER_LIBS= -L/home/oracle/OraHome1/lib -lz -lclntsh
|
|
|
|
#DRIVER_INCS= -Itomas/dblua_oci8/linux/include -I/home/oracle/OraHome1/rdbms/demo -I/home/oracle/OraHome1/rdbms/public
|
|
|
|
|
|
|
|
# MySQL
|
2004-12-14 19:28:12 +00:00
|
|
|
#DRIVER_LIBS= -L/usr/local/mysql/lib -lmysqlclient -lz
|
2004-11-08 15:55:23 +00:00
|
|
|
#DRIVER_INCS= -I/usr/local/mysql/include
|
2003-12-01 16:13:13 +00:00
|
|
|
|
|
|
|
WARN= -Wall -Wmissing-prototypes -Wmissing-declarations -ansi
|
2004-11-08 16:46:51 +00:00
|
|
|
INCS= -I/usr/local/include/lua5
|
|
|
|
LIBS= -llua-5.0 -llualib-5.0 -lm -ldl
|
|
|
|
CFLAGS= -O2 $(WARN) -I$(COMPAT_DIR) $(DRIVER_INCS) $(INCS) $(DEFS)
|
2004-11-08 15:55:23 +00:00
|
|
|
CC= gcc
|
2003-04-07 13:41:29 +00:00
|
|
|
|
2003-05-08 22:46:40 +00:00
|
|
|
PKG= luasql-$(VERSION)
|
2004-11-08 15:55:23 +00:00
|
|
|
DIST_DIR= $(PKG)
|
2003-05-08 22:46:40 +00:00
|
|
|
TAR_FILE= $(PKG).tar.gz
|
|
|
|
ZIP_FILE= $(PKG).zip
|
|
|
|
SRCS= README Makefile \
|
2004-10-15 12:30:26 +00:00
|
|
|
luasql.h luasql.c def.tmpl \
|
2004-11-08 15:59:16 +00:00
|
|
|
ls_postgres.c \
|
2003-08-29 14:25:00 +00:00
|
|
|
ls_odbc.c \
|
|
|
|
ls_oci8.c \
|
|
|
|
ls_mysql.c \
|
2004-08-18 18:10:37 +00:00
|
|
|
ls_sqlite.c \
|
2003-05-08 22:46:40 +00:00
|
|
|
test.lua performance.lua \
|
2004-11-25 18:09:36 +00:00
|
|
|
index.html manual.html license.html authors.html luasql.png
|
2003-04-07 13:41:29 +00:00
|
|
|
|
|
|
|
AR= ar rcu
|
|
|
|
RANLIB= ranlib
|
|
|
|
|
2004-11-08 15:55:23 +00:00
|
|
|
|
2004-11-09 13:15:17 +00:00
|
|
|
lib: $(LIBNAME)
|
|
|
|
|
|
|
|
$(LIBNAME): $(OBJS)
|
2004-11-08 16:46:51 +00:00
|
|
|
$(CC) $(CFLAGS) -o $(LIBNAME) $(LIB_OPTION) $(OBJS) $(DRIVER_LIBS) $(LIBS)
|
2004-10-15 12:28:07 +00:00
|
|
|
|
|
|
|
compat-5.1.o: $(COMPAT_DIR)/compat-5.1.c
|
|
|
|
$(CC) -c $(CFLAGS) -o $@ $(COMPAT_DIR)/compat-5.1.c
|
2003-04-07 13:41:29 +00:00
|
|
|
|
2004-11-08 15:55:23 +00:00
|
|
|
dist: dist_dir
|
|
|
|
tar -czf $(TAR_FILE) $(DIST_DIR)
|
2004-11-24 15:27:59 +00:00
|
|
|
zip -rq $(ZIP_FILE) $(DIST_DIR)/*
|
2004-11-08 15:55:23 +00:00
|
|
|
rm -rf $(DIST_DIR)
|
|
|
|
|
|
|
|
dist_dir:
|
|
|
|
mkdir $(DIST_DIR)
|
2004-11-25 18:09:36 +00:00
|
|
|
mkdir -p $(DIST_DIR)/jdbc/src/java/org/keplerproject/luasql/jdbc
|
|
|
|
mkdir -p $(DIST_DIR)/jdbc/src/lua
|
2004-11-08 15:55:23 +00:00
|
|
|
cp $(SRCS) $(DIST_DIR)
|
2004-11-25 18:09:36 +00:00
|
|
|
cp jdbc/Makefile $(DIST_DIR)/jdbc
|
|
|
|
cp jdbc/build.xml $(DIST_DIR)/jdbc
|
|
|
|
cp jdbc/src/java/org/keplerproject/luasql/jdbc/LuaSQLCursor.java $(DIST_DIR)/jdbc/src/java/org/keplerproject/luasql/jdbc
|
|
|
|
cp jdbc/src/lua/jdbc.lua $(DIST_DIR)/jdbc/src/lua
|
2004-11-08 15:55:23 +00:00
|
|
|
|
|
|
|
install:
|
2004-11-09 13:15:17 +00:00
|
|
|
mkdir -p $(LUA_LIB_DIR)/luasql
|
|
|
|
cp $(LIBNAME) $(LUA_LIB_DIR)/luasql
|
|
|
|
cd $(LUA_LIB_DIR)/luasql; ln -f -s $(LIBNAME) $(LOADLIB)
|
2003-05-26 11:28:31 +00:00
|
|
|
|
2004-11-26 12:29:08 +00:00
|
|
|
jdbc_driver:
|
2004-11-25 16:06:08 +00:00
|
|
|
cd jdbc; make $@
|
|
|
|
|
2003-04-07 13:41:29 +00:00
|
|
|
clean:
|
2004-11-30 15:09:35 +00:00
|
|
|
rm -f $(TAR_FILE) $(ZIP_FILE) $(LIBNAME) *.o
|