@@ -338,6 +338,13 @@ else
338
338
cp -aL $< $@
339
339
endif
340
340
341
+ # ###############################################################################
342
+ # returns difference between GOOS GOARCH and GOHOSTOS GOHOSTARCH.
343
+ cross_compiling = $(call diff,$(GOOS ) $(GOARCH ) ,$(GOHOSTOS ) $(GOHOSTARCH ) )
344
+ # returns true if cross_compiling is empty.
345
+ native_compiling = $(if $(cross_compiling ) ,,true)
346
+
347
+ # ###############################################################################
341
348
# _output/share/man/man1
342
349
.PHONY : manpages
343
350
# Set limactl.1 as explicit dependency.
@@ -346,8 +353,11 @@ endif
346
353
manpages : _output/share/man/man1/limactl.1
347
354
_output/share/man/man1/limactl.1 : _output/bin/limactl$(exe )
348
355
@mkdir -p _output/share/man/man1
356
+ ifeq ($(native_compiling ) ,true)
357
+ # The manpages are generated by limactl, so the limactl binary must be native.
349
358
$< generate-doc _output/share/man/man1 \
350
359
--output _output --prefix $(PREFIX)
360
+ endif
351
361
352
362
# ###############################################################################
353
363
.PHONY : docsy
@@ -357,8 +367,11 @@ _output/share/man/man1/limactl.1: _output/bin/limactl$(exe)
357
367
docsy : website/_output/docsy/limactl.md
358
368
website/_output/docsy/limactl.md : _output/bin/limactl$(exe )
359
369
@mkdir -p website/_output/docsy
370
+ ifeq ($(native_compiling ) ,true)
371
+ # The docs are generated by limactl, so the limactl binary must be native.
360
372
$< generate-doc --type docsy website/_output/docsy \
361
373
--output _output --prefix $(PREFIX)
374
+ endif
362
375
363
376
# ###############################################################################
364
377
.PHONY : diagrams
0 commit comments