@@ -6,6 +6,11 @@ GO ?= go
6
6
TAR ?= tar
7
7
PLANTUML ?= plantuml # may also be "java -jar plantuml.jar" if installed elsewhere
8
8
9
+ GOOS ?= $(shell $(GO ) env GOOS)
10
+ ifeq ($(GOOS ) ,windows)
11
+ exe = .exe
12
+ endif
13
+
9
14
PACKAGE := github.com/lima-vm/lima
10
15
11
16
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
16
21
.PHONY : all
17
22
all : binaries
18
23
24
+ exe : _output/bin/limactl$(exe )
25
+
19
26
.PHONY : binaries
20
27
binaries : clean \
21
28
_output/bin/lima \
22
- _output/bin/limactl \
29
+ _output/bin/limactl$( exe ) \
23
30
_output/bin/nerdctl.lima \
24
31
_output/bin/docker.lima \
25
32
_output/bin/podman.lima \
@@ -29,7 +36,11 @@ binaries: clean \
29
36
cp -aL examples _output/share/lima
30
37
mkdir -p _output/share/doc/lima
31
38
cp -aL * .md LICENSE docs _output/share/doc/lima
39
+ ifneq ($(GOOS ) ,windows)
32
40
ln -sf ../../lima/examples _output/share/doc/lima
41
+ else
42
+ cp -aL examples _output/share/doc/lima
43
+ endif
33
44
echo $(VERSION) > _output/share/doc/lima/VERSION
34
45
35
46
.PHONY : _output/bin/lima
@@ -50,8 +61,8 @@ _output/bin/podman.lima: ./cmd/podman.lima
50
61
@mkdir -p _output/bin
51
62
cp -a $^ $@
52
63
53
- .PHONY : _output/bin/limactl
54
- _output/bin/limactl :
64
+ .PHONY : _output/bin/limactl$( exe )
65
+ _output/bin/limactl$( exe ) :
55
66
# The hostagent must be compiled with CGO_ENABLED=1 so that net.LookupIP() in the DNS server
56
67
# calls the native resolver library and not the simplistic version in the Go library.
57
68
CGO_ENABLED=1 $(GO_BUILD ) -o $@ ./cmd/limactl
@@ -88,7 +99,7 @@ uninstall:
88
99
@test -f " $( DEST) /bin/lima" || echo " lima not found in $( DEST) prefix"
89
100
rm -rf \
90
101
" $( DEST) /bin/lima" \
91
- " $( DEST) /bin/limactl" \
102
+ " $( DEST) /bin/limactl$( exe ) " \
92
103
" $( DEST) /bin/nerdctl.lima" \
93
104
" $( DEST) /bin/docker.lima" \
94
105
" $( DEST) /bin/podman.lima" \
0 commit comments