checkmake is an experimental tool for linting and checking Makefiles. It may not do what you want it to.
% checkmake Makefile
% checkmake --help
checkmake.
Usage:
checkmake [--debug|--config=<configPath>] <makefile>
checkmake -h | --help
checkmake --version
Options:
-h --help Show this screen.
--version Show version.
--debug Enable debug mode
--config=<configPath> Configuration file to read
--list-rules List registered rules
% checkmake fixtures/missing_phony.make
RULE DESCRIPTION LINE NUMBER
minphony Missing required phony target 0
"all"
minphony Missing required phony target 0
"test"
phonydeclared Target "all" should be 18
declared PHONY.
Build the image, or pull it:
docker build . -t checker
Then run it with your Makefile attached, below is an example of it assuming the Makefile is in your current working directory:
docker run -v $(pwd)/Makefile:/Makefile checker
The pandoc document converter utility is required to run checkmate. You can find out if you have it via which pandoc
. Install pandoc if the command was not found.
There are packages for linux up on packagecloud.io or build it yourself with the steps below.
To build checkmake you will need to have golang installed. Once you have Go installed, you can simply clone the repo and build the binary and man page yourself with the following commands.
go get github.com/mrtazz/checkmake
cd $GOPATH/src/github.com/mrtazz/checkmake
make
This is totally inspired by an idea by Dan Buch.