https://github.com/diogocavilha/make-help-generator
A simple Makefile help generator to use on your projects that have a Makefile.
https://github.com/diogocavilha/make-help-generator
bash linux linux-terminal make makefile
Last synced: about 2 months ago
JSON representation
A simple Makefile help generator to use on your projects that have a Makefile.
- Host: GitHub
- URL: https://github.com/diogocavilha/make-help-generator
- Owner: diogocavilha
- Created: 2018-11-30T14:36:56.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2020-09-09T18:29:30.000Z (almost 6 years ago)
- Last Synced: 2025-02-01T16:12:41.028Z (over 1 year ago)
- Topics: bash, linux, linux-terminal, make, makefile
- Language: Shell
- Size: 4.88 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Makefile Helper Generator :dog:
If you are working on a project which has a Makefile containing lots of commands, this might turn your life easier.
## How to use it?
You must to create a file called `MakefileHelp.sh` containing the same conntent as the MakefileHelp.sh in this project. After that, you must set this file execution permission (`chmod +x MakefileHelp.sh`).
The following command will do both:
```bash
wget https://raw.githubusercontent.com/diogocavilha/make-help-generator/master/MakefileHelp.sh \
-q -O MakefileHelp.sh \
&& chmod +x MakefileHelp.sh
```
## How does it work?
- Your Makefile must have some comments in order to generate a properly help message. Like the Makefile example you can find in this project.
- You must have a command called `help`, that will execute the help generator for the Makefile.
**Example:**
Add help comments to your Makefile commands like:
```bash
run:
@# run - Run the project.
# commands...
build:
@# build - Build the project.
# commands...
unit-tests:
@# unit-tests - Run unit tests.
# commands...
integration-tests:
@# integration-tests - Run integration tests.
# commands...
help:
@# help - Show this help.
@./MakefileHelp.sh
```
Take a look at the last command called `help`.
The `help` command will print the Makefile help.
```bash
help:
@# help - Show this help.
@./MakefileHelp.sh
```
Make sure that you have the `MakefileHelp.sh` file in the right path.
After that, you must only type `make help` and voilà! The magic happens!
The above example must print that help:
```bash
$ make help
run - Run the project.
build - Build the project.
unit-tests - Run unit tests.
integration-tests - Run integration tests.
help - Show this help.
```
Now you don't need to read all the Makefile in order to find how exaclty you must type that command you're looking for!