A Builder of Compilation Database
ABCD is a bash tool that generates a JSON compilation database.
The JSON compilation database contains full information on how to parse a translation unit.
So that the tools based on the C/C++ Abstract Syntax Tree can parse a translation unit independently.
Why
It's not easy to generate compilation database under the pure make system.
Athough there are already some tools1 for this job, making them work well is difficult.
How it works
ABCD intercepts the implicit variables CC and CXX in order to receive the compilation commands from make and shell.2
And then ABCD parses the compilation commands and generates a JSON compilation database.
Usage
abcd.sh [make options and target(s)] [-- [-a] [-d] [-h] [-m mk_name] [-o db_file]]
-a use 'arguments' instead of 'command' field in compilation database
-d print debug message
-h display this help and exit
-m mk_name specify path or name of 'make' such as 'gmake'
-o db_file write output to the db_file('./compile_commands.json' by default)
Enter the directory you run make generally, invoke abcd.sh instead. For example,
/path/to/abcd.sh -Bkj <target> -- -o compile_commands.json
Testing
Already tested under Macosx Sierra 10.12.6 and Ubuntu 16.04.
Issues
If you find a bug, please report it to the issue tracker. Please give the detailed description such as OS, projects and so on.
Contribution
Any suggestion and pull request is welcomed :)
License
MIT.
1: Bear, compiledb-generator etc.
2: ABCD also supports 'Scons'-built projects whose 'Sconstruct' exposes CC/CXX:
/path/to/abcd.sh -j 8 <target> -- -m "scons" -o compile_commands.json

Formed in 2009, the Archive Team (not to be confused with the archive.org Archive-It Team) is a rogue archivist collective dedicated to saving copies of rapidly dying or deleted websites for the sake of history and digital heritage. The group is 100% composed of volunteers and interested parties, and has expanded into a large amount of related projects for saving online and digital history.
