23
23
24
24
GO_BUILDTAGS ?=
25
25
ifeq ($(GOOS ) ,darwin)
26
- MACOS_SDK_VERSION = $(shell xcrun --show-sdk-version | cut -d . -f 1)
26
+ MACOS_SDK_VERSION = $(shell xcrun --show-sdk-version | cut -d . -f 1)
27
27
ifeq ($(shell test $(MACOS_SDK_VERSION ) -lt 13; echo $$? ) ,0)
28
28
# The "vz" mode needs macOS 13 SDK or later
29
29
GO_BUILDTAGS += no_vz
43
43
44
44
PACKAGE := github.com/lima-vm/lima
45
45
46
- VERSION = $(shell git describe --match 'v[0-9]* ' --dirty='.m' --always --tags)
46
+ VERSION := $(shell git describe --match 'v[0-9]* ' --dirty='.m' --always --tags)
47
47
VERSION_TRIMMED := $(VERSION:v%=% )
48
48
49
49
GO_BUILD_LDFLAGS := -ldflags="-s -w -X $(PACKAGE ) /pkg/version.Version=$(VERSION ) "
@@ -52,12 +52,17 @@ GO_BUILD_LDFLAGS := -ldflags="-s -w -X $(PACKAGE)/pkg/version.Version=$(VERSION)
52
52
GO_BUILD_FLAG_TAGS := $(addprefix -tags=,$(shell echo "$(GO_BUILDTAGS ) "|tr " " "\n"|paste -sd "," -) )
53
53
GO_BUILD := $(GO ) build $(GO_BUILD_LDFLAGS ) $(GO_BUILD_FLAG_TAGS )
54
54
55
+ # ###############################################################################
56
+ # Features
55
57
.NOTPARALLEL :
56
58
.SECONDEXPANSION :
57
59
60
+ # ###############################################################################
58
61
.PHONY : all
59
62
all : binaries manpages
60
63
64
+ # ###############################################################################
65
+ # Help
61
66
.PHONY : help
62
67
help :
63
68
@echo ' binaries - Build all binaries'
@@ -114,12 +119,16 @@ help-artifact:
114
119
@echo ' Targets for miscellaneous artifacts:'
115
120
@echo ' - artifacts-misc : Build artifacts for go.mod, go.sum, and vendor'
116
121
122
+ # ###############################################################################
123
+ # convenience targets
117
124
exe : _output/bin/limactl$(exe )
118
125
119
126
.PHONY : minimal native
120
127
minimal : clean limactl native-guestagent default_template
121
128
native : clean limactl helpers native-guestagent templates
122
129
130
+ # ###############################################################################
131
+ # Kconfig
123
132
config : Kconfig
124
133
$(KCONFIG_CONF ) $<
125
134
@@ -134,11 +143,13 @@ menuconfig: Kconfig
134
143
135
144
-include .config
136
145
146
+ # ###############################################################################
137
147
.PHONY : binaries
138
148
binaries : limactl helpers guestagents \
139
149
templates template_experimentals create-examples-link \
140
150
documentation create-links-in-doc-dir
141
151
152
+ # ###############################################################################
142
153
# _output/bin
143
154
.PHONY : limactl lima helpers
144
155
limactl : _output/bin/limactl$(exe ) lima
@@ -192,6 +203,9 @@ force_build = $(if $(call compare_build_vars,$(1),$(call extract_build_vars,$(1)
192
203
193
204
force : # placeholder for force build
194
205
206
+ # ###############################################################################
207
+ # _output/bin/limactl$(exe)
208
+
195
209
# dependencies for limactl
196
210
LIMACTL_DEPS = $(call dependencis_for_cmd,limactl)
197
211
ifeq ($(GOOS ) ,darwin)
@@ -228,6 +242,7 @@ _output/bin/%: ./cmd/% | _output/bin
228
242
229
243
MKDIR_TARGETS += _output/bin
230
244
245
+ # ###############################################################################
231
246
# _output/share/lima/lima-guestagent
232
247
LINUX_GUESTAGENT_PATH_COMMON = _output/share/lima/lima-guestagent.Linux-
233
248
@@ -275,9 +290,10 @@ endif
275
290
276
291
MKDIR_TARGETS += _output/share/lima
277
292
293
+ # ###############################################################################
278
294
# _output/share/lima/templates
279
- TEMPLATES = $(addprefix _output/share/lima/templates/,$(filter-out experimental,$(notdir $(wildcard examples/* ) ) ) )
280
- TEMPLATE_EXPERIMENTALS = $(addprefix _output/share/lima/templates/experimental/,$(notdir $(wildcard examples/experimental/* ) ) )
295
+ TEMPLATES = $(addprefix _output/share/lima/templates/,$(filter-out experimental,$(notdir $(wildcard examples/* ) ) ) )
296
+ TEMPLATE_EXPERIMENTALS = $(addprefix _output/share/lima/templates/experimental/,$(notdir $(wildcard examples/experimental/* ) ) )
281
297
282
298
.PHONY : default_template templates template_experimentals
283
299
default_template : _output/share/lima/templates/default.yaml
@@ -296,6 +312,7 @@ _output/share/lima/templates/%: examples/%
296
312
# On Windows, always copy to ensure the target has the same file as the source.
297
313
force_link = $(if $(filter windows,$(GOOS ) ) ,force,$(shell test ! -L $(1 ) && echo force) )
298
314
315
+ # ###############################################################################
299
316
# _output/share/lima/examples
300
317
.PHONY : create-examples-link
301
318
create-examples-link : _output/share/lima/examples
309
326
cp -aL $< $@
310
327
endif
311
328
329
+ # ###############################################################################
312
330
# _output/share/doc/lima
313
- DOCUMENTATION = $(addprefix _output/share/doc/lima/,$(wildcard * .md) LICENSE SECURITY.md VERSION)
331
+ DOCUMENTATION = $(addprefix _output/share/doc/lima/,$(wildcard * .md) LICENSE SECURITY.md VERSION)
314
332
315
333
.PHONY : documentation
316
334
documentation : $(DOCUMENTATION )
@@ -388,6 +406,7 @@ diagrams: docs/lima-sequence-diagram.png
388
406
docs/lima-sequence-diagram.png : docs/images/lima-sequence-diagram.puml
389
407
$(PLANTUML ) ./docs/images/lima-sequence-diagram.puml
390
408
409
+ # ###############################################################################
391
410
.PHONY : install
392
411
install : uninstall
393
412
mkdir -p " $( DEST) "
0 commit comments