compiledb
Tool for generating Clang JSON Compilation Database files for make-based build systems.
What it is and what it does
compiledb is a command-line tool that generates Clang's JSON compilation database format for C/C++ projects built with GNU make. It wraps the make command and extracts compile commands using make's dry-run and keep-going options, avoiding the need for a full clean rebuild. The tool outputs a compile_commands.json file that can be consumed by language servers, IDE plugins, and code analysis tools like YouCompleteMe, cquery, and ccls.
The package is designed for large non-cmake codebases where existing tools like YCM-Generator or Bear were either too slow or incompatible. It supports both the standard 'arguments' list format and the 'command' string format for compilation databases, and can parse compile commands from arbitrary build logs or stdin. It runs on Python 3.3+, depends only on click and bashlex, and has been tested on Windows, Linux, and macOS.
Use it for:
- Set up code navigation and IDE integration for large AOSP or embedded C/C++ projects without rebuilding the entire codebase.
- Generate compilation databases for Vim or Neovim with language server plugins (YouCompleteMe, LanguageClient, ALE) to enable code completion and diagnostics.
- Index legacy C/C++ codebases with make-based build systems for use with static analysis tools and code browsers.
- Integrate compilation database generation into CI/CD pipelines to support code quality and analysis tools without slowing down builds.
- Parse existing build logs to retroactively generate compilation databases for offline analysis or tool integration.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Generates Clang JSON compilation databases from GNU make-based build systems without requiring a clean rebuild, using make's dry-run mode to extract compile commands.
Yes, if you maintain a large make-based C/C++ project and need language server or IDE integration. The low install friction, active maintenance, no security issues, and GPL-3.0-or-later license make it a solid choice for development workflows. Not suitable for proprietary closed-source work due to copyleft licensing.
Install
compiledb on PyPI
pip
pip install compiledbuv
uv add compiledbpoetry
poetry add compiledbInstalling compiledb
Before you install
Low friction: pure Python wheel with only click and bashlex as runtime dependencies. Actively maintained with a recent commit (2026-08-14) and no known vulnerabilities.
License in practice
Licensed under GPL-3.0-or-later (copyleft). Any derivative work or distribution must also be licensed under GPLv3 or later; not suitable for proprietary closed-source projects.
Quickstart
pip install compiledb
# Generate compilation database from make build
compiledb make
# Or parse from existing build log
compiledb --parse build-log.txt
Requires GNU make and a Makefile-based build system; does not work with cmake projects (which already generate compilation databases).
Verify before relying
- Whether the tool correctly handles cross-compilation scenarios beyond the stated 'cross-compiling friendly' claim in the description.
- Performance characteristics on very large codebases compared to similar tools like Bear.
Package facts
| License | GPL-3.0-or-later (copyleft) |
| Python support | supports the current Python release (>=3.3) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 2 — click, bashlex |
| Maintenance | actively maintained — 509 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 201,271/month — #9,676 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: compiledb-0.10.7-py3-none-any.whl
Keywords: compilation-database, clang, c, cpp, makefile, make, language-server, lsp
Tags
More Build Tools packages
Provides reusable utilities for Python…
permissive · top 100 on PyPI
tqdmWraps any iterable to display a real-time…
copyleft · top 100 on PyPI
pippip is the standard installer for Python…
permissive · top 100 on PyPI
hatchlingHatchling is a standards-compliant Python build…
permissive · top 100 on PyPI
grpcio-toolsGenerates Python gRPC service stubs and message…
permissive · top 1,000 on PyPI
pre-commitpre-commit is a framework for installing and…
permissive · top 1,000 on PyPI
conanConan is a decentralized, open-source package…
permissive · top 5,000 on PyPI
scan-buildRuns the Clang static analyzer on C/C++…
permissive · top 15,000 on PyPI
sccachesccache is a compiler caching wrapper that…
permissive · top 5,000 on PyPI
clangProvides Python bindings to libclang, allowing…
permissive · top 5,000 on PyPI
hatch_build_scriptsA Hatch build plugin that runs arbitrary shell…
permissive · top 15,000 on PyPI
mbakembake formats and lints Makefiles, enforcing…
permissive · top 15,000 on PyPI
nanopbNanopb is a code generator and runtime library…
permissive · top 15,000 on PyPI
pccmPCCM manages Python-to-C++ code generation and…
permissive · top 15,000 on PyPI
clangd-tidyclangd-tidy wraps clangd to provide faster…
permissive · top 15,000 on PyPI