build using makefile

This commit is contained in:
Simon Ding
2025-09-02 15:33:17 +08:00
parent bfd97c62d4
commit 44158b3df0
2 changed files with 8 additions and 2 deletions

View File

@@ -1,6 +1,12 @@
.PHONY: windows
VERSION=$(shell git describe --tags --long)
windows:
@echo "Building for Windows..."
go build -tags lib -ldflags="-X polaris/db.Version=$(git describe --tags --long)" -buildmode=c-shared -o ui/windows/libpolaris.dll ./cmd/binding
cd ui && flutter build windows
cd ui && flutter build windows
polaris-web:
@echo "Building..."
CGO_ENABLED=0 go build -o polaris -ldflags="-X polaris/db.Version=$(VERSION) -X polaris/db.DefaultTmdbApiKey=$(TMDB_API_KEY)" ./cmd/polaris

View File

@@ -15,7 +15,7 @@ RUN go mod download
COPY . .
# 指定OS等并go build
RUN CGO_ENABLED=0 go build -o polaris -ldflags="-X polaris/db.Version=$(git describe --tags --long) -X polaris/db.DefaultTmdbApiKey=$(echo $TMDB_API_KEY)" ./cmd/polaris
RUN make polaris-web
FROM debian:stable-slim