2013-08-30 17:28:02 +04:00
|
|
|
ifeq ($(OS),Windows_NT)
|
|
|
|
EXE=extension.exe
|
2020-04-16 08:45:59 +03:00
|
|
|
LIB_EXT=dll
|
2013-08-30 17:28:02 +04:00
|
|
|
RM=cmd /c del
|
|
|
|
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
|
2013-08-30 17:28:02 +04:00
|
|
|
LDFLAG=-fPIC
|
|
|
|
endif
|
2020-04-16 08:45:59 +03:00
|
|
|
LIB=sqlite3_mod_regexp.$(LIB_EXT)
|
2013-08-30 17:28:02 +04:00
|
|
|
|
2020-04-16 08:45:59 +03:00
|
|
|
all : $(EXE) $(LIB)
|
2013-08-30 17:28:02 +04:00
|
|
|
|
|
|
|
$(EXE) : extension.go
|
|
|
|
go build $<
|
|
|
|
|
2020-04-16 08:45:59 +03:00
|
|
|
$(LIB) : sqlite3_mod_regexp.c
|
2013-08-30 17:28:02 +04:00
|
|
|
gcc $(LDFLAG) -shared -o $@ $< -lsqlite3 -lpcre
|
|
|
|
|
|
|
|
clean :
|
2020-04-16 08:45:59 +03:00
|
|
|
@-$(RM) $(EXE) $(LIB)
|