Skip to content

Commit 3af6768

Browse files
authored
Merge pull request #926 from afbjorklund/limactl-exe
Add exe extension to the limactl binary on windows
2 parents e416977 + 1495065 commit 3af6768

File tree

1 file changed

+15
-4
lines changed

1 file changed

+15
-4
lines changed

Makefile

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,11 @@ GO ?= go
66
TAR ?= tar
77
PLANTUML ?= plantuml # may also be "java -jar plantuml.jar" if installed elsewhere
88

9+
GOOS ?= $(shell $(GO) env GOOS)
10+
ifeq ($(GOOS),windows)
11+
exe = .exe
12+
endif
13+
914
PACKAGE := github.com/lima-vm/lima
1015

1116
VERSION=$(shell git describe --match 'v[0-9]*' --dirty='.m' --always --tags)
@@ -16,10 +21,12 @@ GO_BUILD := $(GO) build -ldflags="-s -w -X $(PACKAGE)/pkg/version.Version=$(VERS
1621
.PHONY: all
1722
all: binaries
1823

24+
exe: _output/bin/limactl$(exe)
25+
1926
.PHONY: binaries
2027
binaries: clean \
2128
_output/bin/lima \
22-
_output/bin/limactl \
29+
_output/bin/limactl$(exe) \
2330
_output/bin/nerdctl.lima \
2431
_output/bin/docker.lima \
2532
_output/bin/podman.lima \
@@ -29,7 +36,11 @@ binaries: clean \
2936
cp -aL examples _output/share/lima
3037
mkdir -p _output/share/doc/lima
3138
cp -aL *.md LICENSE docs _output/share/doc/lima
39+
ifneq ($(GOOS),windows)
3240
ln -sf ../../lima/examples _output/share/doc/lima
41+
else
42+
cp -aL examples _output/share/doc/lima
43+
endif
3344
echo $(VERSION) > _output/share/doc/lima/VERSION
3445

3546
.PHONY: _output/bin/lima
@@ -50,8 +61,8 @@ _output/bin/podman.lima: ./cmd/podman.lima
5061
@mkdir -p _output/bin
5162
cp -a $^ $@
5263

53-
.PHONY: _output/bin/limactl
54-
_output/bin/limactl:
64+
.PHONY: _output/bin/limactl$(exe)
65+
_output/bin/limactl$(exe):
5566
# The hostagent must be compiled with CGO_ENABLED=1 so that net.LookupIP() in the DNS server
5667
# calls the native resolver library and not the simplistic version in the Go library.
5768
CGO_ENABLED=1 $(GO_BUILD) -o $@ ./cmd/limactl
@@ -88,7 +99,7 @@ uninstall:
8899
@test -f "$(DEST)/bin/lima" || echo "lima not found in $(DEST) prefix"
89100
rm -rf \
90101
"$(DEST)/bin/lima" \
91-
"$(DEST)/bin/limactl" \
102+
"$(DEST)/bin/limactl$(exe)" \
92103
"$(DEST)/bin/nerdctl.lima" \
93104
"$(DEST)/bin/docker.lima" \
94105
"$(DEST)/bin/podman.lima" \

0 commit comments

Comments
 (0)