skillfed

mbake

A Python-based Makefile formatter and linter

mbake v1.4.6 79.0K downloads/30d#14,390 on PyPI758
Permissive license MIT Active released

What it is and what it does

mbake is a Python-based formatter and linter for Makefiles that enforces consistent style—converting spaces to tabs in recipes, normalizing spacing around assignments and colons, and cleaning up line continuations. It includes intelligent .PHONY detection that analyzes recipe commands to identify targets that don't produce files, and can optionally insert .PHONY declarations automatically. The tool validates Makefile syntax before and after formatting, supports CI/CD workflows with a check mode that reports whether formatting is needed without modifying files, and allows customization through a TOML configuration file.

The package is designed for developers and build systems that need to maintain consistent Makefile style across projects. It integrates with VSCode through an extension and provides command-line commands for formatting, validation, and configuration management. Dependencies are minimal—rich for terminal output, tomli for TOML parsing, and typer for CLI argument handling—making it lightweight to add to existing build pipelines.

Use it for:

  • Enforce consistent Makefile formatting in CI/CD pipelines using --check mode to validate style compliance before merge
  • Auto-format Makefiles in a repository to fix inconsistent spacing, tabs, and line continuations across multiple projects
  • Validate Makefile syntax as part of a build validation step to catch errors before deployment
  • Automatically insert and manage .PHONY declarations based on recipe analysis to prevent false file-target conflicts
  • Integrate with VSCode to format Makefiles on save or on-demand using the mbake extension

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

mbake formats and lints Makefiles, enforcing consistent spacing, tab usage in recipes, and valid syntax while optionally auto-detecting and managing .PHONY declarations.

Yes. mbake fills a genuine gap in Makefile tooling with low install friction, active maintenance, permissive licensing, and no known vulnerabilities. It is well-suited for teams that need consistent Makefile style enforcement or CI/CD validation.

Install

mbake on PyPI

pip

pip install mbake

uv

uv add mbake

poetry

poetry add mbake

Installing mbake

Before you install

Low install friction with three lightweight runtime dependencies (rich, tomli, typer). Active maintenance with recent release and steady repository activity.

License in practice

MIT license permits unrestricted use, modification, and distribution in both open-source and commercial projects with minimal obligations.

Quickstart

pip install mbake
mbake format --check Makefile

Verify before relying

  • Whether GNU make must be installed on the system for validation features to work
  • Scope of Makefile syntax validation coverage across different make dialects
  • Performance characteristics when formatting very large Makefiles

Package facts

License MIT (permissive)
Python support supports the current Python release (>=3.9)
Install friction low — pure-Python wheel
Runtime dependencies 3 — rich, tomli, typer
Maintenance actively maintained — 136 days since the last release
Last repo commit
First released
Downloads 78,960/month — #14,390 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: mbake-1.4.6-py3-none-any.whl

Keywords: build-tools, formatter, linter, makefile

Development Status :: 4 - BetaEnvironment :: ConsoleIntended Audience :: DevelopersLicense :: OSI Approved :: MIT LicenseOperating System :: OS IndependentProgramming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.9Topic :: Software Development :: Build ToolsTopic :: Software Development :: Quality AssuranceTopic :: Text Processing :: Markup

Tags

makefile formattermakefile lintermake syntax checkerbuild file formattermakefile style toolmakefile validationmakefile cleanup
makefile-toolsci-cd-readycode-formatter

More Build Tools packages