diff --git a/tools/README.md b/tools/README.md index b9788eed..b495f777 100644 --- a/tools/README.md +++ b/tools/README.md @@ -4,46 +4,8 @@ This folder contains tools for creating and merging call graphs using the MetaCG ## CaGe -CaGe is MetaCG's link-time call graph generator. -To use it, the target application needs to be built with (full) LTO using the LLD linker. - -### Basic Usage -Let's consider a project that consists of two source files, `example_a.cpp` and `example_b.cpp`. -A standard build process consists of a compile and a link step: -``` -# Compile step -clang++ example_a.cpp -o example_a.o -clang++ example_b.cpp -o example_b.o - -# Link step -clang++ example_a.o example_b.o -o example -``` - -Modifying this build process to generate a call graph with CaGe is straightforward. -All necessary compile flags can be generated with `metacg-config`: - -``` -# Compile step -clang++ $(metacg-config --cage-cxxflags) example_a.cpp -o example_a.o -clang++ $(metacg-config --cage-cxxflags) example_b.cpp -o example_b.o - -# Link step -clang++ $(metacg-config --cage-ldflags --cage-pass-option -cg-file=example.mcg) example_a.o example_b.o -o example -``` - -### Build system integration -Integrating CaGe into build systems, e.g. Make and CMake, is simple. -Many Make projects already define `CXXFLAGS` and `LDFLAGS` variables, which can be extended with the respective -`metacg-config` output. -For CMake projects, the relevant options are `CMAKE_CXX_FLAGS`, `CMAKE_EXE_LINKER_FLAGS` and `CMAKE_SHARED_LINKER_FLAGS`. - -### Pass options -Pass options can be set by passing `--cage-pass-option