2018-06-15 18:53:32 +03:00
|
|
|
# Get Current Directory
|
|
|
|
CURDIR = $(shell pwd)
|
|
|
|
|
2014-01-23 05:56:01 +04:00
|
|
|
ifeq ($(OS),Windows_NT)
|
|
|
|
EXE=extension.exe
|
|
|
|
EXT=sqlite3_mod_vtable.dll
|
|
|
|
RM=cmd /c del
|
|
|
|
LIBCURL=-lcurldll
|
|
|
|
LDFLAG=
|
|
|
|
else
|
|
|
|
EXE=extension
|
|
|
|
EXT=sqlite3_mod_vtable.so
|
|
|
|
RM=rm
|
|
|
|
LDFLAG=-fPIC
|
|
|
|
LIBCURL=-lcurl
|
|
|
|
endif
|
|
|
|
|
2018-06-15 18:53:32 +03:00
|
|
|
# Include source from repository
|
2018-07-20 15:51:46 +03:00
|
|
|
CFLAGS=-I$(CURDIR)/../../driver
|
2018-06-15 18:53:32 +03:00
|
|
|
|
|
|
|
all : $(EXT) $(EXE)
|
2014-01-23 05:56:01 +04:00
|
|
|
|
|
|
|
$(EXE) : extension.go
|
2018-07-20 15:51:46 +03:00
|
|
|
go build -v -tags=sqlite_vtable $<
|
2014-01-23 05:56:01 +04:00
|
|
|
|
|
|
|
$(EXT) : sqlite3_mod_vtable.cc
|
2018-06-15 18:53:32 +03:00
|
|
|
g++ $(LDFLAG) $(CFLAGS) -shared -o $@ $< $(LIBCURL)
|
2014-01-23 05:56:01 +04:00
|
|
|
|
|
|
|
clean :
|
|
|
|
@-$(RM) $(EXE) $(EXT)
|