https://github.com/gibatronic/make-help
Using make as a task runner? Then document your Makefile targets with make-help!
https://github.com/gibatronic/make-help
doc document make makedoc makefile task
Last synced: 7 months ago
JSON representation
Using make as a task runner? Then document your Makefile targets with make-help!
- Host: GitHub
- URL: https://github.com/gibatronic/make-help
- Owner: gibatronic
- License: mit
- Created: 2015-09-11T14:36:23.000Z (almost 11 years ago)
- Default Branch: master
- Last Pushed: 2021-05-16T09:17:36.000Z (about 5 years ago)
- Last Synced: 2025-10-09T02:18:34.799Z (10 months ago)
- Topics: doc, document, make, makedoc, makefile, task
- Language: Shell
- Homepage:
- Size: 15.6 KB
- Stars: 24
- Watchers: 1
- Forks: 0
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# make-help [](https://travis-ci.org/gibatronic/make-help) [](https://gitter.im/gibatronic/make-help?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge)
This is a [npm](https://www.npmjs.com/make-help) package to help you document your make tasks.
## Usage
Install the package with the following command:
```bash
npm install make-help
```
Then document the targets with a comment in your `Makefile`, like so:
```Makefile
# generate all assets
build: scripts styles
# generete scripts
scripts:
...
# generete styles
styles:
...
```
After that, just add a `help` target:
```Makefile
# show some help
help:
echo ''
echo ' Usage:'
echo ' make '
echo ''
echo ' Targets:'
npx make-help -p 4 Makefile
echo ''
```
And voilà! Run `make help` to get a nice usage message:
```
Usage:
make
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`:
```Makefile
.DEFAULT_GOAL := help
```
## System
This project only runs on Unix systems and depends on [AWK](https://en.wikipedia.org/wiki/AWK).