Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -65,11 +65,17 @@ DMR_LDFLAGS := -s -w \
-X main.Version=$(DMR_VERSION) \
-X github.com/docker/model-runner/cmd/cli/desktop.Version=$(DMR_VERSION)

# Add .exe on windows, nothing elsewhere
DMR_EXE := dmr
ifeq ($(OS),Windows_NT)
DMR_EXE := dmr.exe
endif

# build-dmr builds a native dmr binary. dmr has no cgo dependencies, so
# CGO_ENABLED=0 keeps the binary statically linked and trivial to
# cross-compile (see build-dmr-cross).
build-dmr:
CGO_ENABLED=0 go build -ldflags="$(DMR_LDFLAGS)" -o dmr ./cmd/dmr
CGO_ENABLED=0 go build -ldflags="$(DMR_LDFLAGS)" -o $(DMR_EXE) ./cmd/dmr

# build-dmr-cross builds standalone dmr binaries for every platform we
# publish packages for (see packaging/), into dist/dmr/<os>-<arch>/dmr.
Expand Down Expand Up @@ -108,7 +114,7 @@ run: build
# Clean build artifacts
clean:
rm -f $(APP_NAME)
rm -f dmr
rm -f $(DMR_EXE)
rm -f model-runner.sock

# Run tests
Expand Down
2 changes: 1 addition & 1 deletion cmd/dmr/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ dmr rm ai/gemma3 # remove a local model
## Building

```
make build-dmr # native build, output ./dmr
make build-dmr # native build, output ./dmr (or dmr.exe on Windows)
make build-dmr-cross # cross-compile every published target into dist/dmr/<os>-<arch>/
```

Expand Down
Loading