Coder Social home page Coder Social logo

caellian / sourcedepgraph Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 258 KB

A tool that generates include graph from C/C++ source files.

License: GNU General Public License v3.0

Python 100.00%
c cpp dependencies dependency-graph include-files includes source-code-analysis sourcegraph

sourcedepgraph's Introduction

cdepgraph

A tool that generates include graph from C/C++ source files.

example image

It's very primitive and won't work for very unconventional projects, but it should in most cases where:

  • Local include headers are expected to have appropriate extensions (.h,.hh,.hpp,.hxx, etc.)
    • Headers without extensions are assumed to belong to stdlib
  • Sources are expected to have appropriate extensions (.c,.cc,.cpp,.cxx, etc.)
  • Compile flags aren't handled
  • A single program entry point is expected (e.g. main.cpp)

Usage

usage: cdepgraph [-h] [-m MAIN_FILE] [-i INCLUDE_PATHS] [-l] [-e] [-s] [-c] [-o OUTPUT] [-F OUTPUT_FORMAT] SOURCE_DIRECTORY

Generates include graph from C/C++ source files

positional arguments:
  SOURCE_DIRECTORY      Source directory containing program entry point

options:
  -h, --help            show this help message and exit
  -m MAIN_FILE, --main-file MAIN_FILE
                        Main file name and extension; default is any of main.c/cc/cpp/etc.
  -i INCLUDE_PATHS, --include-paths INCLUDE_PATHS
                        Semicolon (;) separated list of additional include paths
  -l, --std-lib         Include standard library includes in produced graph
  -e, --system          Include system includes in produced graph
  -s, --strict          Exclude includes which can't be found
  -c, --check-sources   Check includes of corresponding source files
  -o OUTPUT, --output OUTPUT
                        Output file name
  -F OUTPUT_FORMAT, --output-format OUTPUT_FORMAT
                        Output file format

Runs well on most Linux distros, running on other platforms will require adjusting INCLUDE_PATHS constant for -l argument to work.

Requirements

All requirements can be found in requirements.txt file.

PyGraphviz is required to generate .dot files.

Future Work

In future, the following improvements could potentially be made:

  • Loading previously generated files for visualization. (why?)

License

This tool is licensed under GPLv3 license.

sourcedepgraph's People

Contributors

caellian avatar

Watchers

 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.