diff mbox series

[3/3] multipath-tools: support generating compile_commands.json

Message ID 20211112210551.12744-3-mwilck@suse.com (mailing list archive)
State Not Applicable, archived
Delegated to: christophe varoqui
Headers show
Series [1/3] multipath-tools: support ABI testing with libabigail | expand

Commit Message

Martin Wilck Nov. 12, 2021, 9:05 p.m. UTC
From: Martin Wilck <mwilck@suse.com>

This file is necessary to run clangd as helper for an IDE, e.g.
with emacs lsp-mode.

Signed-off-by: Martin Wilck <mwilck@suse.com>
---
 .gitignore | 1 +
 Makefile   | 6 ++++++
 2 files changed, 7 insertions(+)

Comments

Benjamin Marzinski Nov. 17, 2021, 6:20 p.m. UTC | #1
On Fri, Nov 12, 2021 at 10:05:51PM +0100, mwilck@suse.com wrote:
> From: Martin Wilck <mwilck@suse.com>
> 
> This file is necessary to run clangd as helper for an IDE, e.g.
> with emacs lsp-mode.
> 
> Signed-off-by: Martin Wilck <mwilck@suse.com>
Reviewed-by: Benjamin Marzinski <bmarzins@redhat.com>
> ---
>  .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@redhat.com
https://listman.redhat.com/mailman/listinfo/dm-devel
diff mbox series

Patch

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