Makefile 368 B

123456789101112131415161718192021222324
  1. ifeq ($(OS),Windows_NT)
  2. EXE=extension.exe
  3. EXT=sqlite3_mod_vtable.dll
  4. RM=cmd /c del
  5. LIBCURL=-lcurldll
  6. LDFLAG=
  7. else
  8. EXE=extension
  9. EXT=sqlite3_mod_vtable.so
  10. RM=rm
  11. LDFLAG=-fPIC
  12. LIBCURL=-lcurl
  13. endif
  14. all : $(EXE) $(EXT)
  15. $(EXE) : extension.go
  16. go build $<
  17. $(EXT) : sqlite3_mod_vtable.cc
  18. g++ $(LDFLAG) -shared -o $@ $< -lsqlite3 $(LIBCURL)
  19. clean :
  20. @-$(RM) $(EXE) $(EXT)