From 207af96f4eb3220534ea06c2e107517372246544 Mon Sep 17 00:00:00 2001 From: Robin Haberkorn Date: Wed, 23 Sep 2026 00:24:23 +0200 Subject: generate compile_flags.txt This can be read by clangd as an alternative to compile_commands.json (which would be trickier to generate with Autotools). However, since this is generated in the build directory, it may not always be picked up automatically -- a build/ directory should work, but otherwise you might have to pass --compile-commands-dir to clangd. --- src/Makefile.am | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'src/Makefile.am') diff --git a/src/Makefile.am b/src/Makefile.am index fa6c0e4..eb532e3 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -12,6 +12,7 @@ include $(top_srcdir)/bootstrap.am include $(top_srcdir)/contrib/scintilla.am # FIXME: Common flags should be in configure.ac +# See also compile_flags.txt. AM_CFLAGS = -std=gnu11 -Wall -Wno-initializer-overrides -Wno-unused-value AM_CPPFLAGS += -I$(top_srcdir)/contrib/rb3ptr -I$(top_srcdir)/contrib/terex \ -I$(top_srcdir)/contrib/sj.h @@ -22,7 +23,12 @@ if STATIC_EXECUTABLES AM_LDFLAGS += -all-static endif -BUILT_SOURCES = +BUILT_SOURCES = compile_flags.txt + +# for clangd +compile_flags.txt : GNUmakefile + printf '%s\n' $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ + $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) >$@ dist_noinst_SCRIPTS = symbols-extract.tes -- cgit v1.2.3