Skip to content

Commit

Permalink
docker: add a Makefile trick to auto-complete implicit rules
Browse files Browse the repository at this point in the history
Bash completion figures out the targets from the Makefile, but ignores
implicit/pattern rules. Add some magic to create real docker-test.* and
docker-html.* targets to get proper autocompletion.
  • Loading branch information
jnikula committed Mar 24, 2024
1 parent 755457b commit 0ac44c8
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions docker/Makefile.local
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ docker-html.%: hawkmoth-test.% FORCE
mkdir -p doc/_build
docker run $(DOCKER_TEST_OUT_MOUNT) $< make BUILDDIR=/out html

docker-test: docker-test.debian-bullseye FORCE
docker-html: docker-test-html.debian-bullseye FORCE
# Generate targets for auto-completion
$(shell find $(docker_dir) -name 'Dockerfile.*' | sed 's/.*\.\(.*\)/docker-test.\1 docker-html.\1/'):

FORCE:

Expand Down

0 comments on commit 0ac44c8

Please sign in to comment.