Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/krisnova/Makefile
Makefile example. All Makefiles should have "help"
https://github.com/krisnova/Makefile
command example gist github grep help krisnova make makefile nova sample
Last synced: 3 months ago
JSON representation
Makefile example. All Makefiles should have "help"
- Host: GitHub
- URL: https://github.com/krisnova/Makefile
- Owner: krisnova
- Created: 2017-10-25T18:17:42.000Z (about 7 years ago)
- Default Branch: main
- Last Pushed: 2022-04-05T17:23:53.000Z (over 2 years ago)
- Last Synced: 2024-07-24T01:59:42.095Z (4 months ago)
- Topics: command, example, gist, github, grep, help, krisnova, make, makefile, nova, sample
- Language: Makefile
- Homepage:
- Size: 6.84 KB
- Stars: 18
- Watchers: 2
- Forks: 3
- Open Issues: 6
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
Awesome Lists containing this project
README
# Makefile
There is a legendary `make help` target that has been floating around my career.
The idea is that you can add a simple `help` target to your makefile. Then get `make help` for free just by adding comments to a target.
```
example: ## Any double commented target now becomes help!
```---
### Sebastian Gryczan
Contributed by [@sgryczan](https://github.com/sgryczan).
```bash
help:
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[32m%-30s\033[0m %s\n", $$1, $$2}'
```### Kris Nóva
Contributed by [@kris-nova](https://github.com/kris-nova).
```bash
.PHONY: help
help: ## Show help messages for make targets
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[32m%-30s\033[0m %s\n", $$1, $$2}'
```