1616# is imported, Go will build the ./c/sqlite.c file that is included directly by
1717# static.go. However this is pretty slow ~30s. When developing this is very
1818# annoying. Use this Makefile to pre-build the sqlite3.o object and then build
19- # the package with the build tag linksqlite3 , which will ignore static.go and
19+ # the package with the build tag link , which will ignore static.go and
2020# use link.go instead to link against sqlite.o. This reduces compilation times
21- # down to <3 sec!
21+ # down to < 3 sec!
2222#
2323# If you are using an editor that builds the project as you work on it, you'll
2424# want to build the sqlite3.o object and tell your editor to use the
25- # linksqlite3 go build tag when working on this project.
26- # For vim-go, use the command `GoBuildTags linksqlite3 ` or
27- # `let g:go_build_tags = # 'linksqlite3 '`
25+ # link go build tag when working on this project.
26+ # For vim-go, use the command `GoBuildTags link ` or
27+ # `let g:go_build_tags = # 'link '`
2828
29- export GOFLAGS=-tags =linksqlite3
30-
31- .PHONY : clean all env test release
29+ .PHONY : clean all env test sqleet test-all
3230all : sqlite3.o
33- go build ./...
31+ go build -tags=link ./...
32+
33+ test-all : test test-sqleet
3434
3535test : sqlite3.o
36- go test ./...
36+ go test -tags=link ./...
3737
38- env :
39- go env
38+ sqleet : sqleet.o
39+ go build -tags=link,sqleet ./...
4040
41- # # This builds the package statically.
42- release :
43- go build -tags=! linksqlite3
41+ test-sqleet : sqleet.o
42+ go test -tags=link,sqleet ./
4443
45- VPATH = ./c # Look in ./c for source files
44+ # Paths to look for source files
45+ VPATH = ./c/sqlite ./c/sqleet
4646
4747# !!! THESE DEFINES SHOULD MATCH sqlite.go for linux !!!
4848CFLAGS += -std=c99
@@ -65,8 +65,5 @@ CFLAGS += -DSQLITE_ENABLE_GEOPOLY
6565LDFLAGS = -ldl -lm
6666# !!! THESE DEFINES SHOULD MATCH sqlite.go !!!
6767
68- sqlite3.o : sqlite3.c sqlite3.h sqlite3ext.h
69-
70-
7168clean :
72- rm -f sqlite3.o
69+ rm -f sqlite3.o sqleet.o
0 commit comments