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