From 3c216356b631d04deba38a3dac43d1a48bc26df6 Mon Sep 17 00:00:00 2001 From: Andrew Rogers Date: Mon, 9 Oct 2023 02:33:21 -0500 Subject: [PATCH] [NEW] make-lsp: Generate clangd command JSON for make targets Currently my silly-cc project kind of sucks, but I need a way to generate my compile commands for LSP on Makefile-based and Autotools-based projects. This shell script should work most of the time provided your Makefiles aren't silencing the emission of compile commands with a prepending dash ("-") on targets that we care about. --- scripts/make-lsp | 51 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) create mode 100755 scripts/make-lsp diff --git a/scripts/make-lsp b/scripts/make-lsp new file mode 100755 index 0000000..9b3cfc4 --- /dev/null +++ b/scripts/make-lsp @@ -0,0 +1,51 @@ +#!/usr/bin/env bash + +: ' + * Attempt to generate clangd compile commands for a GNU Make target. + ' + +. "$(dirname $0)/util/logging.bash" + +define_usage <