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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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>
---
 .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




[Index of Archives]     [DM Crypt]     [Fedora Desktop]     [ATA RAID]     [Fedora Marketing]     [Fedora Packaging]     [Fedora SELinux]     [Yosemite Discussion]     [KDE Users]     [Fedora Docs]

  Powered by Linux