From a52f850274b6761a8e520f0f1d696430342287d7 Mon Sep 17 00:00:00 2001 From: Norio Nomura Date: Fri, 20 Sep 2024 10:20:01 +0900 Subject: [PATCH] Makefile: add `help-targets` target and revert `help` to simple as previous Signed-off-by: Norio Nomura --- Makefile | 47 +++++++++++++++++++++++++++++++++-------------- 1 file changed, 33 insertions(+), 14 deletions(-) diff --git a/Makefile b/Makefile index ed23228310b..1718c49ccaf 100644 --- a/Makefile +++ b/Makefile @@ -55,24 +55,34 @@ help: @echo ' binaries - Build all binaries' @echo ' manpages - Build manual pages' @echo - @echo ' limactl - Build limactl, and lima' - @echo ' lima - Copy lima, and lima.bat' - @echo ' helpers - Copy nerdctl.lima, apptainer.lima, docker.lima, podman.lima, kubectl.lima' + @echo " Use 'make help-targets' to see additional targets." + +.PHONY: help-targets +help-targets: + @echo '# Targets can be categorized by their location.' + @echo + @echo 'Targets for files in _output/bin/:' + @echo '- limactl : Build limactl, and lima' + @echo '- lima : Copy lima, and lima.bat' + @echo '- helpers : Copy nerdctl.lima, apptainer.lima, docker.lima, podman.lima, and kubectl.lima' @echo - @echo ' guestagents - Build guestagents for archs enabled by CONFIG_GUESTAGENT_ARCHS_*' - @echo ' native-guestagent - Build guestagent for native arch' - @echo ' additional-guestagents - Build guestagents for archs other than native arch' + @echo 'Targets for files in _output/share/lima/:' + @echo '- guestagents : Build guestagents for archs enabled by CONFIG_GUESTAGENT_ARCHS_*' + @echo '- native-guestagent : Build guestagent for native arch' + @echo '- additional-guestagents : Build guestagents for archs other than native arch' @echo - @echo ' templates - Copy templates' - @echo ' template_experimentals - Copy experimental templates' - @echo ' default_template - Copy default.yaml template' - @echo ' create-examples-link - Create a symlink at _output/share/lima/examples pointing to _output/share/lima/templates' + @echo 'Targets for files in _output/share/lima/templates/:' + @echo '- templates : Copy templates' + @echo '- template_experimentals : Copy experimental templates to experimental/' + @echo '- default_template : Copy default.yaml template' + @echo '- create-examples-link : Create a symlink at ../examples pointing to templates' @echo - @echo ' documents - Copy documents' - @echo ' create-links-in-documents - Create symlinks in documents' + @echo 'Targets for files in _output/share/doc/lima:' + @echo '- documents : Copy documents to _output/share/doc/lima' + @echo '- create-links-in-documents : Create some symlinks pointing ../../lima/templates' @echo - @echo ' e.g. to install limactl, native guestagent, and templates:' - @echo ' make clean limactl native-guestagent templates install' + @echo '# e.g. to install limactl, helpers, native guestagent, and templates:' + @echo '# make native install' exe: _output/bin/limactl$(exe) @@ -150,6 +160,15 @@ endif guestagents: $(GUESTAGENTS) native-guestagent: $(NATIVE_GUESTAGENT) additional-guestagents: $(ADDITIONAL_GUESTAGENTS) +%-guestagent: + echo "'$(*)'" + echo "'$(findstring $(*),$(GUESTAGENT_ARCHS))'" +ifeq "$*" "$(findstring $*,$(GUESTAGENT_ARCHS))" + echo equal +endif +ifeq ($(findstring $(*),$(GUESTAGENT_ARCHS)),$(*)) + @make _output/share/lima/lima-guestagent.Linux-$* +endif _output/share/lima/lima-guestagent.Linux-%: | _output/share/lima GOOS=linux $(GUESTAGENT_ARCH_ENVS_$*) CGO_ENABLED=0 $(GO_BUILD) -o $@ ./cmd/lima-guestagent chmod 644 $@