Windows Makefile (except JDBC)

master
mascarenhas 2007-03-21 23:12:57 +00:00
parent e00c33c287
commit c8080c7687
8 changed files with 105 additions and 28 deletions

32
Makefile.win Normal file
View File

@ -0,0 +1,32 @@
LUA_INC=c:\lua5.1\include
LUA_DIR=c:\lua5.1\lua
LUA_LIBDIR=c:\lua5.1\lib
LUA_LIB=c:\lua5.1\bin\lua5.1.lib
T=odbc
DRIVER_INCLUDE=
DRIVER_LIBS="C:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\Lib\odbc32.lib"
OBJS= src\luasql.obj src\ls_$T.obj
.c.obj:
cl /c /Fo$@ /O2 /I$(LUA_INC) /D_CRT_SECURE_NO_DEPRECATE $(DRIVER_INCLUDE) $<
src\$T.dll: $(OBJS)
link /dll /def:src\$T.def /out:$@ $(OBJS) $(DRIVER_LIBS) $(LUA_LIB)
install: src/$T.dll
IF NOT EXIST $(LUA_LIBDIR)\luasql mkdir $(LUA_LIBDIR)\luasql
copy src\$T.dll $(LUA_LIBDIR)\luasql
IF NOT EXIST $(LUA_DIR)\luasql mkdir $(LUA_DIR)\luasql
copy src\ado\ado.lua $(LUA_DIR)\luasql
jdbc_driver:
cd src\jdbc
nmake -f Makefile.win $@
clean:
del src\$T.dll
del src\*.obj

35
src/jdbc/Makefile.win Normal file
View File

@ -0,0 +1,35 @@
# JDBC
JDK= $(JAVA_HOME)
#source dir
JDBC_SRC= src\java
#lib dir
JDBC_LIB= lib
#build dir
JDBC_BUILD= bin
#java compiler
JAVAC= $(JAVA_HOME)\bin\javac.exe
JAR= $(JAVA_HOME)\bin\jar.exe
#luajava jar name
LUAJAVA_JAR= luajava-1.0b4.jar
#compilation options
COMPILEOPT= -d $(JDBC_BUILD) -classpath $(JDBC_LIB)\$(LUAJAVA_JAR)
#package name
ALLPACKAGES= org/keplerproject/luasql/jdbc
SUBDIRS= addprefix $(JDBC_SRC), $(ALLPACKAGES)
SOURCEDIRS= $(JDBC_SRC)/$(ALLPACKAGES)
SOURCEFILES = $(addsuffix /*.java, $(SOURCEDIRS))
JARSDIR= .
PACKAGENAME= luasql
jdbc_driver:
rm -rf $(JDBC_BUILD)
mkdir $(JDBC_BUILD)
for i in $(SUBDIRS); \
do ( $(JAVAC) $(COMPILEOPT) $(SOURCEFILES) ) done
$(JAR) -cvf $(JARSDIR)/$(PACKAGENAME).jar -C $(JDBC_BUILD) .
clean:
rm -rf $(JDBC_BUILD)
rm -f $(JARSDIR)/$(PACKAGENAME).jar

View File

@ -1,28 +1,28 @@
/*
** $Id: luasql.h,v 1.10 2004/11/05 13:27:14 tomas Exp $
** See Copyright Notice in license.html
*/
#ifndef _LUASQL_
#define _LUASQL_
#ifndef LUASQL_API
#define LUASQL_API
#endif
#define LUASQL_PREFIX "LuaSQL: "
#define LUASQL_TABLENAME "luasql"
#define LUASQL_ENVIRONMENT "Each driver must have an environment metatable"
#define LUASQL_CONNECTION "Each driver must have a connection metatable"
#define LUASQL_CURSOR "Each driver must have a cursor metatable"
typedef struct {
short closed;
} pseudo_data;
LUASQL_API int luasql_faildirect (lua_State *L, const char *err);
LUASQL_API int luasql_createmeta (lua_State *L, const char *name, const luaL_reg *methods);
LUASQL_API void luasql_setmeta (lua_State *L, const char *name);
LUASQL_API void luasql_set_info (lua_State *L);
#endif
/*
** $Id: luasql.h,v 1.11 2007/03/21 23:12:57 mascarenhas Exp $
** See Copyright Notice in license.html
*/
#ifndef _LUASQL_
#define _LUASQL_
#ifndef LUASQL_API
#define LUASQL_API
#endif
#define LUASQL_PREFIX "LuaSQL: "
#define LUASQL_TABLENAME "luasql"
#define LUASQL_ENVIRONMENT "Each driver must have an environment metatable"
#define LUASQL_CONNECTION "Each driver must have a connection metatable"
#define LUASQL_CURSOR "Each driver must have a cursor metatable"
typedef struct {
short closed;
} pseudo_data;
LUASQL_API int luasql_faildirect (lua_State *L, const char *err);
LUASQL_API int luasql_createmeta (lua_State *L, const char *name, const luaL_reg *methods);
LUASQL_API void luasql_setmeta (lua_State *L, const char *name);
LUASQL_API void luasql_set_info (lua_State *L);
#endif

2
src/mysql.def Normal file
View File

@ -0,0 +1,2 @@
EXPORTS
luaopen_luasql_mysql

2
src/oci8.def Normal file
View File

@ -0,0 +1,2 @@
EXPORTS
luaopen_luasql_oci8

2
src/odbc.def Normal file
View File

@ -0,0 +1,2 @@
EXPORTS
luaopen_luasql_odbc

2
src/postgres.def Normal file
View File

@ -0,0 +1,2 @@
EXPORTS
luaopen_luasql_postgres

2
src/sqlite.def Normal file
View File

@ -0,0 +1,2 @@
EXPORTS
luaopen_luasql_sqlite