From 82d5d7f5572da5526f74202824e3f0688f1802ee Mon Sep 17 00:00:00 2001 From: watercoldyi Date: Tue, 11 Apr 2017 20:30:37 +0800 Subject: [PATCH 1/2] add compliling for mingw --- Makefile.mingw | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 Makefile.mingw diff --git a/Makefile.mingw b/Makefile.mingw new file mode 100644 index 0000000..c153229 --- /dev/null +++ b/Makefile.mingw @@ -0,0 +1,29 @@ +LUA_INC = -I/usr/local/include +LUA_LIB = -L/usr/local/lib -llua53 +DRIVER_INC = ./driver +DRIVER_LIB = ./driver +CFLAG = -Wall -O2 -shared +CC = gcc +LUA_DIR = /usr/local/lib/lua/5.3/luasql + +all: + echo "press mysql,sqlite,sqlite3,odbc" + +mysql:src/mysql.dll + +src/mysql.dll:src/luasql.c src/ls_mysql.c + $(CC) $(CFLAG) $(LUA_INC) $(LUA_LIB) -I$(DRIVER_INC)/mysql/include -L$(DRIVER_LIB)/mysql/lib/ -lmysql -o $@ $^ + +src/sqlite3.dll:src/luasql.c src/ls_sqlite3.c + $(CC) $(CFLAG) $(LUA_INC) $(LUA_LIB) -I$(DRIVER_INC)/sqlite3/include -L$(DRIVER_LIB)/sqlite3/lib/ -lsqlite3 -o $@ $^ + +install: + -mkdir $(LUA_DIR) + -cp src/*.dll $(LUA_DIR) +uninstall: + -rm -rf $(LUA_DIR) +clean: + -rm src/*.dll + + + From ace2aaa241a08b61f6b5ff607af667b792a35abd Mon Sep 17 00:00:00 2001 From: watercoldyi Date: Tue, 11 Apr 2017 20:58:20 +0800 Subject: [PATCH 2/2] compliling in mingw,odbc,sqlite3 --- Makefile.mingw | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/Makefile.mingw b/Makefile.mingw index c153229..2a6cca5 100644 --- a/Makefile.mingw +++ b/Makefile.mingw @@ -1,5 +1,5 @@ LUA_INC = -I/usr/local/include -LUA_LIB = -L/usr/local/lib -llua53 +LUA_LIB = -L/usr/local/lib DRIVER_INC = ./driver DRIVER_LIB = ./driver CFLAG = -Wall -O2 -shared @@ -10,12 +10,17 @@ all: echo "press mysql,sqlite,sqlite3,odbc" mysql:src/mysql.dll +sqlite3:src/sqlite3.dll +odbc:src/odbc.dll src/mysql.dll:src/luasql.c src/ls_mysql.c - $(CC) $(CFLAG) $(LUA_INC) $(LUA_LIB) -I$(DRIVER_INC)/mysql/include -L$(DRIVER_LIB)/mysql/lib/ -lmysql -o $@ $^ + $(CC) $(CFLAG) $(LUA_INC) $(LUA_LIB) -I$(DRIVER_INC)/mysql/include -L$(DRIVER_LIB)/mysql/lib/ -o $@ $^ -llua53 -lmysql src/sqlite3.dll:src/luasql.c src/ls_sqlite3.c - $(CC) $(CFLAG) $(LUA_INC) $(LUA_LIB) -I$(DRIVER_INC)/sqlite3/include -L$(DRIVER_LIB)/sqlite3/lib/ -lsqlite3 -o $@ $^ + $(CC) $(CFLAG) $(LUA_INC) $(LUA_LIB) -I$(DRIVER_INC)/sqlite3/include -L$(DRIVER_LIB)/sqlite3/lib/ -o $@ $^ -lsqlite3 -llua53 + +src/odbc.dll:src/luasql.c src/ls_odbc.c + $(CC) $(CFLAG) $(LUA_INC) $(LUA_LIB) -o $@ $^ -lodbc32 -llua53 install: -mkdir $(LUA_DIR)