Skip to content

Using make as a task runner? Then document your Makefile targets with make-help!

License

Notifications You must be signed in to change notification settings

gibatronic/make-help

Folders and files

NameName
Last commit message
Last commit date

Latest commit

f83d942 · May 16, 2021

History

32 Commits
May 24, 2016
Sep 14, 2015
Oct 13, 2015
Sep 11, 2015
Sep 11, 2015
Mar 24, 2016
May 16, 2021
Mar 3, 2018
Mar 3, 2018
Mar 3, 2018
Mar 3, 2018

Repository files navigation

make-help Build Status Gitter

This is a npm package to help you document your make tasks.

Usage

Install the package with the following command:

npm install make-help

Then document the targets with a comment in your Makefile, like so:

# generate all assets
build: scripts styles

# generete scripts
scripts:
	...

# generete styles
styles:
	...

After that, just add a help target:

# show some help
help:
	echo ''
	echo '  Usage:'
	echo '    make <target>'
	echo ''
	echo '  Targets:'
	npx make-help -p 4 Makefile
	echo ''

And voilà! Run make help to get a nice usage message:


  Usage:
    make <target>

  Targets:
    build    generate all assets
    help     show some help
    scripts  generete scripts
    styles   generete styles

Tip:

Tell make to use help as the default goal when no targets are provided, put the following line at the top of your makefile:

.DEFAULT_GOAL := help

System

This project only runs on Unix systems and depends on AWK.

About

Using make as a task runner? Then document your Makefile targets with make-help!

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published