1LUA_INC = -I/usr/local/include 2LUA_LIB = -L/usr/local/lib 3DRIVER_INC = ./driver 4DRIVER_LIB = ./driver 5CFLAG = -Wall -O2 -shared 6CC = gcc 7LUA_DIR = /usr/local/lib/lua/5.3/luasql 8 9all: 10 echo "press mysql,sqlite,sqlite3,odbc" 11 12mysql:src/mysql.dll 13sqlite3:src/sqlite3.dll 14odbc:src/odbc.dll 15 16src/mysql.dll:src/luasql.c src/ls_mysql.c 17 $(CC) $(CFLAG) $(LUA_INC) $(LUA_LIB) -I$(DRIVER_INC)/mysql/include -L$(DRIVER_LIB)/mysql/lib/ -o $@ $^ -llua53 -lmysql 18 19src/sqlite3.dll:src/luasql.c src/ls_sqlite3.c 20 $(CC) $(CFLAG) $(LUA_INC) $(LUA_LIB) -I$(DRIVER_INC)/sqlite3/include -L$(DRIVER_LIB)/sqlite3/lib/ -o $@ $^ -lsqlite3 -llua53 21 22src/odbc.dll:src/luasql.c src/ls_odbc.c 23 $(CC) $(CFLAG) $(LUA_INC) $(LUA_LIB) -o $@ $^ -lodbc32 -llua53 24 25install: 26 -mkdir $(LUA_DIR) 27 -cp src/*.dll $(LUA_DIR) 28uninstall: 29 -rm -rf $(LUA_DIR) 30clean: 31 -rm src/*.dll 32 33 34 35