ax_rd
2 hours ago 62a9f6223745c0df42be1f4226f31dfb10c83ea8
Makefile
@@ -1,20 +1,24 @@
.PHONY: build test clean install
# Makefile
CGO_CFLAGS := -DSQLITE_ENABLE_FTS5
CGO_LDFLAGS := -lm
.PHONY: build test clean install test-v run-search run-index run-status
# 构建
build:
   CGO_ENABLED=1 go build -tags fts5 -o bin/kb-cli .
   CGO_CFLAGS="$(CGO_CFLAGS)" CGO_LDFLAGS="$(CGO_LDFLAGS)" go build -o bin/kb-cli .
# 安装到 ~/go/bin
install:
   CGO_ENABLED=1 go install -tags fts5 .
   CGO_CFLAGS="$(CGO_CFLAGS)" CGO_LDFLAGS="$(CGO_LDFLAGS)" go install .
# 测试
test:
   CGO_ENABLED=1 go test -tags fts5 ./...
   CGO_CFLAGS="$(CGO_CFLAGS)" CGO_LDFLAGS="$(CGO_LDFLAGS)" go test ./... 2>&1 | grep -v "no test files"
# 详细测试
test-v:
   CGO_ENABLED=1 go test -tags fts5 -v ./...
   CGO_CFLAGS="$(CGO_CFLAGS)" CGO_LDFLAGS="$(CGO_LDFLAGS)" go test -v ./... 2>&1 | grep -v "no test files"
# 清理
clean: