forked from intel/aog
-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathMakefile
More file actions
31 lines (26 loc) · 1.04 KB
/
Makefile
File metadata and controls
31 lines (26 loc) · 1.04 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
# 先获取 GOOS 和 GOARCH
GOOS := $(shell go env GOOS)
GOARCH := $(shell go env GOARCH)
SQLITE_VEC_DIR ?= $(abspath internal/datastore/sqlite/sqlite-vec)
build-all:
ifeq ($(GOOS),windows)
$(MAKE) build-cli-win build-dll-win
else ifeq ($(GOOS),darwin)
ifeq ($(GOARCH),amd64)
$(MAKE) build-cli-darwin build-dll-darwin
else
$(MAKE) build-cli-darwin-arm build-dll-darwin-arm
endif
else ifeq ($(GOOS),linux)
$(MAKE) build-cli-linux build-dll-linux
else
@echo "Unsupported platform: $(GOOS)"
endif
build-cli-win:
CGO_ENABLED=1 CGO_CFLAGS=-I$(SQLITE_VEC_DIR) GOOS=windows GOARCH=amd64 go build -o oadin.exe -ldflags="-s -w" cmd/cli/main.go
build-cli-darwin:
CGO_ENABLED=1 CGO_CFLAGS=-I$(SQLITE_VEC_DIR) GOOS=darwin GOARCH=amd64 go build -o oadin -ldflags="-s -w" cmd/cli/main.go
build-cli-darwin-arm:
CGO_ENABLED=1 CGO_CFLAGS=-I$(SQLITE_VEC_DIR) GOOS=darwin GOARCH=arm64 go build -o oadin -ldflags="-s -w" cmd/cli/main.go
build-cli-linux:
CGO_ENABLED=1 CGO_CFLAGS=-I$(SQLITE_VEC_DIR) GOOS=linux GOARCH=amd64 go build -o oadin -ldflags="-s -w" cmd/cli/main.go