Giter VIP home page Giter VIP logo

compiledb-generator's Introduction

Compilation Database Generator

Tool for generating clang/LLVM's JSON Compilation Database file for make-based build systems.

It's aimed mainly at non-cmake (cmake already generates compilation database) large codebases. Inspired by projects like YCM-Generator and Bear, but it's supposed to be faster (mainly with large projects), since it doesn't need a clean build (as the current available tools do) to get the compile commands, to achieve this it uses the make options -Bnk to generate the compilation database file. Also, it's more cross-compiling friendly than YCM-generator's fake-toolchanin approach.

Dependencies

  • Python >= 2.7
  • GNU make ( >= version?)

Usage

Generate compile_commands.json using compiledb-generator's "make wrapper" script, executing Makefile target all:

$ compiledb-gen-make all > compile_commands.json

Generate compile_commands.json using compiledb-generator's "make wrapper" script, using custom_makefile.mk as main Makefile:

$ compiledb-gen-make -f custom_makefile.mk > compile_commands.json

Genrate compile_commands.json for some AOSP module (assuming you're running the script from the root of AOSP tree):

$ compiledb-gen-aosp -o compile_commands.json <aosp/module/path>

Parse a build log file and prints the compilation database to stdout:

$ compiledb-gen-parser . < build-log.txt

Testing / Contributing

I've implemented it basically because I needed to index some AOSP's modules for navigating and studying purposes (after having no satisfatory results with current tools such as YCM-Generator and Bear). So I've reworked YCM-Generator, which resulted in compiledb-gen-parser and used successfully to generate compilation database for some AOSP modules in ~1min running in a [Docker][docker] container and then I've been able to use some great tools such as Vim + YouCompleteMe + rtags + chromatica.nvim with the codebase.

Even though it's working ok in my environment, with AOSP 5.0, etc, it's still a work in progress and not well tested yet. So, give it a try! Report the issues you got, and maybe send some PR's :)

  • Windows not supported yet (at least not tested yet in Cygwin/MinGW)
  • Tested only on Linux (Arch Linux) so far

License

GNU GPLv3

compiledb-generator's People

Contributors

eklitzke avatar lyonlh avatar nickdiego avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.