A Unix/Linux shell script to generate compile_commands.json
for C projects.
- Generate
compile_commands.json
for any C project - Supports custom compiler, language standard, source/include directories, and compile flags
- Filter by file extensions
- Exclude directories from scanning
- Configurable indentation level in output JSON
- Verbose mode for detailed output
git clone https://github.com/wxrayut/ccg.git
cd ccg
chmod +x ccg.sh
A full dummy C project is included in the test/
folder for testing.
./ccg.sh \
--directory test \
--output compile_commands.json \
--compiler gcc \
--std c11 \
--flags "-Wall -O2" \
--extensions c,h \
--verbose
If you find this useful, donβt forget to β star the repo and share it with others!