From fd62678a9cf38e3f70efbdd093c1012d448548e1 Mon Sep 17 00:00:00 2001 From: Thomas Vanbesien Date: Sat, 21 Feb 2026 15:57:50 +0100 Subject: Add compile_commands.json generation for clangd support --- Makefile | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'Makefile') diff --git a/Makefile b/Makefile index c1af191..5774cc9 100644 --- a/Makefile +++ b/Makefile @@ -31,6 +31,7 @@ $(OBJDIR): clean: rm -rf $(OBJDIR) + rm -f compile_commands.json fclean: clean rm -f $(NAME) @@ -41,4 +42,8 @@ re: fclean all test: $(NAME) $(MAKE) -C tests +compile_commands.json: $(SRCS:%=$(SRCDIR)/%) + @echo '$(foreach src,$(SRCS),{"directory":"$(CURDIR)","command":"$(CC) $(CFLAGS) -I $(INCDIR) -c $(SRCDIR)/$(src)","file":"$(SRCDIR)/$(src)"})' \ + | jq -s '.' > $@ + .PHONY: all clean fclean re test -- cgit v1.2.3