2014-01-23 01:56:01 +00:00
|
|
|
ifeq ($(OS),Windows_NT)
|
|
|
|
EXE=extension.exe
|
2020-04-16 05:45:59 +00:00
|
|
|
LIB_EXT=dll
|
2014-01-23 01:56:01 +00:00
|
|
|
RM=cmd /c del
|
|
|
|
LIBCURL=-lcurldll
|
|
|
|
LDFLAG=
|
|
|
|
else
|
|
|
|
EXE=extension
|
2020-04-16 05:45:59 +00:00
|
|
|
ifeq ($(shell uname -s),Darwin)
|
|
|
|
LIB_EXT=dylib
|
|
|
|
else
|
|
|
|
LIB_EXT=so
|
|
|
|
endif
|
|
|
|
RM=rm -f
|
2014-01-23 01:56:01 +00:00
|
|
|
LDFLAG=-fPIC
|
|
|
|
LIBCURL=-lcurl
|
|
|
|
endif
|
2020-04-16 05:45:59 +00:00
|
|
|
LIB=sqlite3_mod_vtable.$(LIB_EXT)
|
2014-01-23 01:56:01 +00:00
|
|
|
|
2020-04-16 05:45:59 +00:00
|
|
|
all : $(EXE) $(LIB)
|
2014-01-23 01:56:01 +00:00
|
|
|
|
|
|
|
$(EXE) : extension.go
|
|
|
|
go build $<
|
|
|
|
|
2020-04-16 05:45:59 +00:00
|
|
|
$(LIB) : sqlite3_mod_vtable.cc
|
2014-01-23 01:56:01 +00:00
|
|
|
g++ $(LDFLAG) -shared -o $@ $< -lsqlite3 $(LIBCURL)
|
|
|
|
|
|
|
|
clean :
|
2020-04-16 05:45:59 +00:00
|
|
|
@-$(RM) $(EXE) $(LIB)
|