Skip to content

Commit

Permalink
Makefile: add help-targets target and revert help to simple as pr…
Browse files Browse the repository at this point in the history
…evious

Signed-off-by: Norio Nomura <norio.nomura@gmail.com>
  • Loading branch information
norio-nomura committed Sep 20, 2024
1 parent 0df11ac commit a52f850
Showing 1 changed file with 33 additions and 14 deletions.
47 changes: 33 additions & 14 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down Expand Up @@ -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 $@
Expand Down

0 comments on commit a52f850

Please sign in to comment.