Skip to content

Commit

Permalink
fix(docs): use wrapper script for extracting make-based projects (#4997)
Browse files Browse the repository at this point in the history
  • Loading branch information
justbuchanan committed Jul 29, 2021
1 parent 3044115 commit 1df8f54
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions kythe/web/site/examples.md
Expand Up @@ -234,7 +234,7 @@ $ /opt/kythe/tools/runextractor cmake \
## Extracting projects built with `make`
Projects built with make can be extracted by substituting the C/C++ compiler with Kythe's cxx_extractor binary.
Projects built with make can be extracted by substituting the C/C++ compiler with a wrapper script that invokes both Kythe's cxx_extractor binary and the actual C/C++ compiler.
Given a simple example project:
Expand All @@ -258,6 +258,14 @@ bin: main.cc
```
```shell
# cxx_wrapper.sh
#!/bin/bash -e
$KYTHE_RELEASE_DIR/extractors/cxx_extractor "$@" &
/usr/bin/c++ "$@"
```
Extraction is done by setting the `CXX` make variable as well as some environment variables that configure `cxx_extractor`.
```shell
Expand All @@ -269,7 +277,7 @@ export KYTHE_CORPUS=mycorpus
export KYTHE_ROOT_DIRECTORY="$PWD"
export KYTHE_OUTPUT_DIRECTORY=/tmp/extract
export CXX="$KYTHE_RELEASE_DIR/extractors/cxx_extractor"
export CXX="cxx_wrapper.sh"
mkdir -p "$KYTHE_OUTPUT_DIRECTORY"
Expand Down

0 comments on commit 1df8f54

Please sign in to comment.