luasql/Makefile

85 lines
1.8 KiB
Makefile
Raw Normal View History

#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
#LIB_EXT= .so
LIB_EXT= .dylib
#LIB_OPTION= -shared
LIB_OPTION= -dynamiclib
COMPAT_DIR= ../compat
2004-11-03 10:46:06 +00:00
VERSION= 2.0b2
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
#DRIVER_LIBS= -L/usr/local/mysql/lib -lmysqlclient
#DRIVER_INCS= -I/usr/local/mysql/include
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)
CC= gcc
PKG= luasql-$(VERSION)
DIST_DIR= $(PKG)
TAR_FILE= $(PKG).tar.gz
ZIP_FILE= $(PKG).zip
SRCS= README Makefile \
luasql.h luasql.c def.tmpl \
ls_postgres.c \
ls_odbc.c \
ls_oci8.c \
ls_mysql.c \
ls_sqlite.c \
test.lua performance.lua \
index.html manual.html license.html authors.html luasql.png
AR= ar rcu
RANLIB= ranlib
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)
compat-5.1.o: $(COMPAT_DIR)/compat-5.1.c
$(CC) -c $(CFLAGS) -o $@ $(COMPAT_DIR)/compat-5.1.c
dist: dist_dir
tar -czf $(TAR_FILE) $(DIST_DIR)
zip -rq $(ZIP_FILE) $(DIST_DIR)/*
rm -rf $(DIST_DIR)
dist_dir:
mkdir $(DIST_DIR)
cp $(SRCS) $(DIST_DIR)
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)
clean:
rm -f $(TAR_FILE) $(ZIP_FILE) $(LIBNAME) *.o *.lua