add compliling for mingw

This commit is contained in:
watercoldyi 2017-04-11 20:30:37 +08:00
parent 9e319eef48
commit 82d5d7f557

29
Makefile.mingw Normal file
View File

@ -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