Put Your Project's Dependencies in Make

Stick your dependencies in a Makefile to make it easy to install.

My scavenger hunt repo only has a few dependencies, but the Makefile still has each one. It works like this:

1 [ ~/scavenger ] $ make
2
3check    Check you have the project dependencies.
4clean    Remove generated files.
5help     Print the help message.
6hunt     Make the PDFs for all scavenger spreadsheets.

The default target is help. The check target cycles through the dependencies.

1 [ ~/scavenger ] $ make check
2
3install pdflatex
4make: *** [Makefile:49: check] Error 1

The Makefile just needs these lines:

 1.PHONY: help
 2help: ## Print the help message.
 3	@awk 'BEGIN {FS = ":.*?## "} /^[0-9a-zA-Z._-]+:.*?## / {printf "\033[36m%s\033[0m : %s\n", $$1, $$2}' $(MAKEFILE_LIST) | \
 4		sort | \
 5		column -s ':' -t
 6
 7dependencies = recsel dot pdflatex
 8
 9.PHONY: check
10check: ## Check you have the project dependencies
11	@$(foreach program, $(dependencies), \
12	command -v $(program) >/dev/null || { echo install $(program) && exit 1 ;} ;)