compiledb

0.10.7 · active · verified Thu Apr 16

compiledb is a Python tool designed for generating Clang's JSON Compilation Database files, primarily for GNU make-based build systems. It targets large codebases that do not use CMake, which typically generates its own compilation database. The library is currently at version 0.10.7 and is actively maintained, with releases occurring as needed rather than on a strict schedule.

Common errors

Warnings

Install

Quickstart

The primary usage of compiledb is as a wrapper around your `make` command. It executes your build while intercepting and parsing the compilation commands to produce the `compile_commands.json` file. You can also generate the database from an existing build log.

# Assuming you have a Makefile in the current directory
# This command will execute 'make' and generate 'compile_commands.json'
compiledb make

# To skip the actual build and only generate the database from make's dry run:
# compiledb -n make

# To parse an existing build log file:
# make -Bnwk > build.log
# compiledb --parse build.log

view raw JSON →