Blog
Use a help target in your Makefile

In one of my previous blog. I wrote how you could make your life easier when you start using Makefile. But when you start using Makefile in many projects. The targets that you use may vary from project to project.
In this blog post I will address a trick how you could write a help
target. Lets imagine that we have a project that allow you to build
, start
and stop
a docker container. These names are pretty straightforward. But without looking in the Makefile you never know for sure.
By calling the help
target you could list all available targets:
make help
When you have a look at the Makefile used for this blog post. It looks like this:
.DEFAULT_GOAL:=help
.PHONY: help
help: ## Display this help
$(info Example Makefile for my blog post)
awk 'BEGIN {FS = ":.*##"; printf "nUsage:n make 33[36m<target>