unmake: a makefile linter

text _ _ _ ___ _____ ___| |_ ___ | | | | | .'| '_| -_| |___|_|_|_|_|_|__,|_,_|___|

ABOUT

unmake checks makefiles for syntax errors and portability issues.

EXAMPLES

```console $ cd fixtures

$ unmake . error: ./parse-invalid/crlf.mk:1:5 found "\r", expected: LF, comment, inline command, macro expansion, target, wait prerequisite marker warning: ./parse-valid/Makefile:0 MAKEFILEPRECEDENCE: lowercase Makefile to makefile for launch speed warning: ./parse-valid/boilerplate-ats.mk:4 SIMPLIFYAT: replace individual at (@) signs with .SILENT target declaration(s) warning: ./parse-valid/missing-posix.mk:1 STRICT_POSIX: lead makefiles with the .POSIX: compliance marker, or rename to *.include.mk ... ```

See unmake -h for more options.

NOTABLE FEATURES

unmake applies a stricter reading of POSIX syntax than make -n. Whereas make -n may skip inactive sections depending on control flow, unmake scans each line. For example, make -n may only check instructions specific to building the default task.

In fact, the two checks complement each other. make -n checks for dry-run runtime issues. unmake checks for syntactic portability issues.

Directory recursion

unmake automatically recurses over directories.

When recursing over directories, unmake skips symlinks.

unmake skips many implementation-specific files such as GNUmakefile.

unmake skips many machine-generated makefiles. For example, makefiles produced by autotools; Perl; and cmake when using the Unix Makefile generator (both in-source builds and out-of-source builds).

unmake skips any third party makefiles house in subdirectories like .git, node_modules, or vendor.

To investigate makefiles in more detail, try the --debug or --inspect options.

PARSE ERRORS

unmake can identify low level makefile quirks, such as invalid syntax.

See SYNTAX.md for more information.

WARNINGS

unmake can identify higher level portability recommendations for makefiles.

See WARNINGS.md for more information.

CRATE

https://crates.io/crates/unmake

API DOCUMENTATION

https://docs.rs/unmake/latest/unmake/

DOWNLOAD

https://github.com/mcandre/unmake/releases

INSTALL FROM SOURCE

console $ cargo install --force --path .

RUNTIME REQUIREMENTS

(None)

Recommended

CONTRIBUTING

For more details on developing crit itself, see DEVELOPMENT.md.

LICENSE

FreeBSD

MORE EXAMPLES

Some projects using unmake to safeguard their makefiles:

SEE ALSO