24/01/2022

Générer une doc makeFile automatiquement

Dans un premier temps, commentez chaque fonctions

install: ## Build the project
	USER_ID=$(shell id -u) GROUP_ID=$(shell id -g) $(DOCKER_COMPOSE) up --build -d

Ensuite créz la command help. Pour cela j’ai 2 designs différents Ajoutez celui que vous préféré :

help: ## Show this help.
    @sed -ne '/@sed/!s/## //p' $(MAKEFILE_LIST)
help: ## Show this help.
    @egrep -h '\s##\s' $(MAKEFILE_LIST) | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m  %-30s\033[0m %s\n", $$1, $$2}'

Ensuite pour afficher la doc tapez la commande make help. Maintenant à chaque nouvelle fonction dans votre Makefile il faudra rajouter une petite description (comme expliqué plus haut)