Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ianstormtaylor/makefile-help
An easy way to add a `make help` target to your Makefiles.
https://github.com/ianstormtaylor/makefile-help
make makefile nodejs
Last synced: 6 days ago
JSON representation
An easy way to add a `make help` target to your Makefiles.
- Host: GitHub
- URL: https://github.com/ianstormtaylor/makefile-help
- Owner: ianstormtaylor
- Created: 2017-04-12T05:09:04.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2017-04-12T05:24:31.000Z (over 7 years ago)
- Last Synced: 2024-10-12T02:52:59.005Z (23 days ago)
- Topics: make, makefile, nodejs
- Language: Makefile
- Size: 3.91 KB
- Stars: 25
- Watchers: 4
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: Readme.md
Awesome Lists containing this project
README
# makefile-help
An easy way to add an auto-generated `make help` target to your Node.js project's `Makefile`.
This makes `make` command discovery nicer, while still using the same `make` tool that's available in pretty much every dev environment. If you're looking for something a bit more powerful, but at the expense of installing something new, check out [`tj/mmake`](https://github.com/tj/mmake)!
---
### Example
For a makefile like...
```make
ifneq ($(wildcard ./node_modules),)
include ./node_modules/makefile-help/Makefile
endif# Run commands with the node debugger. (default: false)
DEBUG ?= falseifeq ($(DEBUG),false)
node = node
else
node = node debug
endif# Remove all of the derived files.
clean:
@ rm -rf ./node_modules ./lib# Compile the source with babel.
lib:
@ ./node_modules/.bin/babel-cli --out-dir ./lib ./src# Start the development server.
start:
@ $(node) ./server/index.js
```Running `make help` will print out...
```bash
$ make helpUsage:
make [flags...]
Targets:
clean Remove all of the derived files.
help Show this help prompt.
lib Compile the source with babel.
start Start the development server.Flags:
DEBUG Run commands with the node debugger. (default: false)
```
---
### Installation
```bash
yarn add makefile-help
``````bash
npm install --save makefile-help
```---
### Usage
To use it, `include` this module's `Makefile` in your own...
```make
ifneq ($(wildcard ./node_modules),)
include ./node_modules/makefile-help/Makefile
endif
```And then run...
```bash
$ make help
```The help command will auto-populate from targets that look like:
```make
# This comment will show up for the target in the help.
target:
```And also for flag definitions like:
```make
# This comment will show up for the flag in the help.
FLAG ?=
```