Makefile 330 B

12345678910111213141516171819202122
  1. ifeq ($(OS),Windows_NT)
  2. EXE=extension.exe
  3. EXT=sqlite3_mod_regexp.dll
  4. RM=cmd /c del
  5. LDFLAG=
  6. else
  7. EXE=extension
  8. EXT=sqlite3_mod_regexp.so
  9. RM=rm
  10. LDFLAG=-fPIC
  11. endif
  12. all : $(EXE) $(EXT)
  13. $(EXE) : extension.go
  14. go build $<
  15. $(EXT) : sqlite3_mod_regexp.c
  16. gcc $(LDFLAG) -shared -o $@ $< -lsqlite3 -lpcre
  17. clean :
  18. @-$(RM) $(EXE) $(EXT)