On Fri, Nov 12, 2021 at 10:05:51PM +0100, mwilck@xxxxxxxx wrote: > From: Martin Wilck <mwilck@xxxxxxxx> > > This file is necessary to run clangd as helper for an IDE, e.g. > with emacs lsp-mode. > > Signed-off-by: Martin Wilck <mwilck@xxxxxxxx> Reviewed-by: Benjamin Marzinski <bmarzins@xxxxxxxxxx> > --- > .gitignore | 1 + > Makefile | 6 ++++++ > 2 files changed, 7 insertions(+) > > diff --git a/.gitignore b/.gitignore > index 5dbac39..8e09f95 100644 > --- a/.gitignore > +++ b/.gitignore > @@ -17,6 +17,7 @@ mpathpersist/mpathpersist > abi.tar.gz > abi > abi-test > +compile_commands.json > .nfs* > *.swp > *.patch > diff --git a/Makefile b/Makefile > index 1cec777..82e0ea3 100644 > --- a/Makefile > +++ b/Makefile > @@ -66,6 +66,12 @@ abi-test: abi reference-abi $(wildcard abi/*.abi) > fi; \ > [ $$err -eq 0 ] > > +# Create compile_commands.json, useful for using clangd with an IDE > +# Requires bear (https://github.com/rizsotto/Bear) > +compile_commands.json: Makefile Makefile.inc $(BUILDDIRS:=/Makefile) > + $(MAKE) clean > + bear -- $(MAKE) > + > libmultipath libdmmp: libmpathcmd > libmpathpersist libmpathvalid multipath multipathd: libmultipath > libmultipath/prioritizers libmultipath/checkers libmultipath/foreign: libmultipath > -- > 2.33.1 -- dm-devel mailing list dm-devel@xxxxxxxxxx https://listman.redhat.com/mailman/listinfo/dm-devel