Skip to content

Instantly share code, notes, and snippets.

@amitu amitu/Makefile
Created Apr 12, 2016

Embed
What would you like to do?
Self documenting makefile
.DEFAULT_GOAL := help
node_modules: ## Install dependencies.
node_modules: package.json
npm install
help: ## Show this help.
@IFS=$$'\n' ; \
help_lines=(`fgrep -h "##" $(MAKEFILE_LIST) | fgrep -v fgrep | sed -e 's/\\$$//' | sed -e 's/##/:/'`); \
for help_line in $${help_lines[@]}; do \
IFS=$$':' ; \
help_split=($$help_line) ; \
help_command=`echo $${help_split[0]} | sed -e 's/^ *//' -e 's/ *$$//'` ; \
help_info=`echo $${help_split[2]} | sed -e 's/^ *//' -e 's/ *$$//'` ; \
printf '\033[36m'; \
printf "%-15s %s" $$help_command ; \
printf '\033[0m'; \
printf "%s\n" $$help_info; \
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.