#

LUA=$(HOME)/lua-5.0
CFLAGS=-I/usr/local/include -g -I$(LUA)/include
LFLAGS=-g -L/usr/local/lib

all: test libluaodbc.so

test: test.o
	$(CC) -o $@ $^ $(LFLAGS) -llua -llualib -ldl -lm
	
odbclua.o:CFLAGS+= -fPIC

libluaodbc.so: odbclua.o
	$(CC) -o $@ $^ $(LFLAGS) -shared -fPIC -llua -llualib -lodbc

install:
	install -C -D libluaodbc.so /usr/local/lib/libluaodbc.so

clean:
	rm -f *.o *.so *.bak test
