2003-04-07 13:41:29 +00:00
|
|
|
WARN= -Wall -Wmissing-prototypes -Wmissing-declarations
|
2003-05-30 10:08:27 +00:00
|
|
|
INCS= -I/usr/local/include/lua5 -I/usr/local/pgsql/include -Itomas/dblua_oci8/linux/include -I/home/oracle/OraHome1/rdbms/demo -I/home/oracle/OraHome1/rdbms/public
|
|
|
|
LIBS_DIR= -L/usr/local/pgsql/lib -L../lua-5.0/lib -L/home/oracle/OraHome1/lib
|
|
|
|
LIBS= -llua.5.0 -llualib.5.0 -lm -lz -ldl
|
|
|
|
CFLAGS= -g $(MYCFLAGS) $(WARN) $(INCS) $(DEFS)
|
2003-04-07 13:41:29 +00:00
|
|
|
|
|
|
|
ODBC_OBJ= ls_odbc.o
|
|
|
|
PG_OBJ= ls_pg.o
|
2003-05-26 11:28:31 +00:00
|
|
|
OCI_OBJ= ls_oci8.o
|
|
|
|
MYSQL_OBJ= ls_mysql.o
|
2003-04-07 13:41:29 +00:00
|
|
|
LS_OBJ= luasql.o
|
|
|
|
|
2003-05-08 22:46:40 +00:00
|
|
|
VERSION= 2.0a
|
|
|
|
PKG= luasql-$(VERSION)
|
|
|
|
TAR_FILE= $(PKG).tar.gz
|
|
|
|
ZIP_FILE= $(PKG).zip
|
|
|
|
SRCS= README Makefile \
|
2003-08-29 14:25:00 +00:00
|
|
|
luasql.h luasql.c def.tmpl loader.tmpl \
|
|
|
|
ls_pg.c \
|
|
|
|
ls_odbc.c \
|
|
|
|
ls_oci8.c \
|
|
|
|
ls_mysql.c \
|
2003-05-08 22:46:40 +00:00
|
|
|
test.lua performance.lua \
|
|
|
|
index.html manual.html lua.png
|
2003-04-07 13:41:29 +00:00
|
|
|
|
|
|
|
AR= ar rcu
|
|
|
|
RANLIB= ranlib
|
|
|
|
|
2003-05-08 22:46:40 +00:00
|
|
|
ODBC_LIB= libluasqlodbc.$(VERSION).a
|
2003-05-26 11:28:31 +00:00
|
|
|
ODBC_DLL= luasqlodbc.$(VERSION).dll
|
2003-05-08 22:46:40 +00:00
|
|
|
PG_LIB= libluasqlpostgres.$(VERSION).a
|
|
|
|
PG_SO= libluasqlpostgres.$(VERSION).so
|
|
|
|
PG_DYLIB= libluasqlpostgres.$(VERSION).dylib
|
2003-05-26 11:28:31 +00:00
|
|
|
OCI_LIB= libluasqloci8.$(VERSION).a
|
2003-05-30 10:08:27 +00:00
|
|
|
OCI_SO= libluasqloci8.$(VERSION).so
|
2003-05-26 11:28:31 +00:00
|
|
|
OCI_DLL= luasqloracle.$(VERSION).dll
|
|
|
|
MYSQL_LIB= libluasqlmysql.$(VERSION).a
|
|
|
|
MYSQL_SO= libluasqlmysql.$(VERSIOIN).so
|
|
|
|
MYSQL_DLL= luasqlmysql.$(VERSION).dll
|
2003-04-07 13:41:29 +00:00
|
|
|
|
2003-05-05 10:06:34 +00:00
|
|
|
dist:
|
2003-05-08 22:46:40 +00:00
|
|
|
#cd ..; tar -czf luasql-2.0.tar.gz $(SRCS)
|
|
|
|
mkdir $(PKG);
|
|
|
|
cp $(SRCS) $(PKG);
|
|
|
|
tar -czf $(TAR_FILE) $(PKG);
|
|
|
|
zip -lq $(ZIP_FILE) $(PKG)/*
|
|
|
|
rm -rf $(PKG)
|
2003-05-05 10:06:34 +00:00
|
|
|
|
2003-04-07 13:41:29 +00:00
|
|
|
pglinux: $(PG_LIB) $(PG_SO)
|
2003-05-26 11:28:31 +00:00
|
|
|
sed -e "s/LIB_NAME/$(PG_SO)/" -e "s/DRIVER/postgres/" loader.tmpl > postgres.lua
|
2003-04-07 13:41:29 +00:00
|
|
|
|
|
|
|
pgmac: $(PG_LIB) $(PG_DYLIB)
|
2003-05-26 11:28:31 +00:00
|
|
|
sed -e "s/LIB_NAME/$(PG_DYLIB)/" -e "s/DRIVER/postgres/" loader.tmpl > postgres.lua
|
2003-04-15 18:26:08 +00:00
|
|
|
|
|
|
|
odbcwin:
|
2003-05-26 11:28:31 +00:00
|
|
|
sed -e "s/LIB_NAME/$(ODBC_DLL)/" -e "s/DRIVER/odbc/" loader.tmpl > odbc.lua
|
|
|
|
sed -e "s/VERSION/$(VERSION)/" -e "s/DRIVER/odbc/" def.tmpl > odbc.def
|
|
|
|
|
|
|
|
ocilinux: $(OCI_LIB) $(OCI_SO)
|
|
|
|
sed -e "s/LIB_NAME/$(OCI_SO)/" -e "s/DRIVER/oracle/" loader.tmpl > oracle.lua
|
|
|
|
|
|
|
|
ociwin:
|
|
|
|
sed -e "s/LIB_NAME/$(OCI_SO)/" -e "s/DRIVER/oracle/" loader.tmpl > oracle.lua
|
|
|
|
sed -e "s/VERSION/$(VERSION)/" -e "s/DRIVER/oracle/" def.tmpl > oracle.def
|
|
|
|
|
|
|
|
mysqllinux: $(MYSQL_LIB) $(MYSQL_SO)
|
|
|
|
sed -e "s/LIB_NAME/$(MYSQL_SO)/" -e "s/DRIVER/mysql/" loader.tmpl > mysql.lua
|
|
|
|
|
|
|
|
mysqlwin:
|
|
|
|
sed -e "s/LIB_NAME/$(MYSQL_SO)/" -e "s/DRIVER/mysql/" loader.tmpl > mysql.lua
|
|
|
|
sed -e "s/VERSION/$(VERSION)/" -e "s/DRIVER/mysql/" def.tmpl > mysql.def
|
2003-04-07 13:41:29 +00:00
|
|
|
|
|
|
|
$(PG_LIB): $(LS_OBJ) $(PG_OBJ)
|
|
|
|
$(AR) $@ $(LS_OBJ) $(PG_OBJ)
|
|
|
|
$(RANLIB) $@
|
|
|
|
|
|
|
|
$(PG_SO): $(LS_OBJ) $(PG_OBJ)
|
2003-05-30 10:08:27 +00:00
|
|
|
gcc -o $@ -shared $(LS_OBJ) $(PG_OBJ) $(LIBS_DIR) -lpq $(LIBS)
|
2003-04-07 13:41:29 +00:00
|
|
|
|
|
|
|
$(PG_DYLIB): $(LS_OBJ) $(PG_OBJ)
|
2003-05-30 10:08:27 +00:00
|
|
|
gcc -o $@ -dynamiclib $(LS_OBJ) $(PG_OBJ) $(LIBS_DIR) -lpq $(LIBS)
|
2003-04-07 13:41:29 +00:00
|
|
|
|
2003-05-26 11:28:31 +00:00
|
|
|
$(OCI_LIB): $(LS_OBJ) $(OCI_OBJ)
|
|
|
|
$(AR) $@ $(LS_OBJ) $(OCI_OBJ)
|
|
|
|
$(RANLIB) $@
|
|
|
|
|
|
|
|
$(OCI_SO): $(LS_OBJ) $(OCI_OBJ)
|
2003-05-30 10:08:27 +00:00
|
|
|
gcc -o $@ -shared $(LS_OBJ) $(OCI_OBJ) $(LIBS_DIR) -lclntsh $(LIBS)
|
2003-05-26 11:28:31 +00:00
|
|
|
|
|
|
|
$(MYSQL_LIB): $(LS_OBJ) $(MYSQL_OBJ)
|
|
|
|
$(AR) $@ $(LS_OBJ) $(MYSQL_OBJ)
|
|
|
|
$(RANLIB) $@
|
|
|
|
|
|
|
|
$(MYSQL_SO): $(LS_OBJ) $(MYSQL_OBJ)
|
|
|
|
gcc -o $@ -shared $(LS_OBJ) $(MYSQL_OBJ) $(LIBS_DIR) $(LIBS)
|
|
|
|
|
2003-04-07 13:41:29 +00:00
|
|
|
clean:
|
2003-09-12 18:48:55 +00:00
|
|
|
rm -f $(LS_OBJ) $(ODBC_OBJ) $(PG_OBJ) $(OCI_OBJ) $(MY_OBJ) $(ODBC_LIB) $(ODBC_DLL) $(PG_LIB) $(PG_SO) $(PG_DYLIB) $(OCI_LIB) $(OCI_SO) $(MYSQL_LIB) $(MYSQL_SO) postgres.lua odbc.lua oracle.lua mysql.lua
|