Conversation

Jarkko Sakkinen

Edited 3 days ago

Got tired of updating clangd data manually so did a quick script to automate it :

#!/usr/bin/env bash
# Copyright (c) Jarkko Sakkinen 2025

set -e

run_build() {
  make ARCH=x86_64 O=.clangd -j$(nproc)
  scripts/clang-tools/gen_compile_commands.py -d .clangd
}

run_menuconfig() {
  if [[ ! -d .clangd ]]; then
    exit 1
  fi
  make ARCH=x86_64 O=.clangd menuconfig
  run_build
}

while getopts ":m" opt; do
  case $opt in
    m)
      run_menuconfig
      exit 0
      ;;
    *)
      echo "Usage: $0 [-m]"
      exit 1
      ;;
  esac
done

if [[ ! -d .clangd ]]; then
  make ARCH=x86_64 O=.clangd tinyconfig
fi
run_build

#linux #kernel #clangd

0
1
0