Makefile uses Bear to improve clangd

This commit is contained in:
Emile Clark-Boman 2025-08-28 00:11:54 +10:00
parent f6a4c76b54
commit 9f304641b2
3 changed files with 10 additions and 5 deletions

View file

@ -38,7 +38,7 @@ setup:
all: setup $(BIN)/$(BINARY) $(BUILD)/$(BINARY).desktop all: setup $(BIN)/$(BINARY) $(BUILD)/$(BINARY).desktop
$(BIN)/$(BINARY): $(call mkobj,main.o util.o) $(BIN)/$(BINARY): $(call mkobj,main.o util.o)
$(CC) $^ $(DWLCFLAGS) $(LDFLAGS) $(LDLIBS) -o $@ $(CC) $^ $(DWLCFLAGS) $(LDFLAGS) $(LDLIBS) -o $@
$(OBJ)/main.o: $(call mksrc,main.c client.h) config.mk $(call mkinclude,config.h cursor-shape-v1-protocol.h \ $(OBJ)/main.o: $(call mksrc,main.c) config.mk $(call mkinclude,config.h cursor-shape-v1-protocol.h \
pointer-constraints-unstable-v1-protocol.h wlr-layer-shell-unstable-v1-protocol.h \ pointer-constraints-unstable-v1-protocol.h wlr-layer-shell-unstable-v1-protocol.h \
wlr-output-power-management-unstable-v1-protocol.h xdg-shell-protocol.h) wlr-output-power-management-unstable-v1-protocol.h xdg-shell-protocol.h)
$(OBJ)/util.o: $(call mksrc,util.c util.h) $(OBJ)/util.o: $(call mksrc,util.c util.h)

View file

@ -41,4 +41,5 @@ XLIBS =
# dwl itself only uses C99 features, but wlroots' headers use anonymous unions (C11). # dwl itself only uses C99 features, but wlroots' headers use anonymous unions (C11).
# To avoid warnings about them, we do not use -std=c99 and instead of using the # To avoid warnings about them, we do not use -std=c99 and instead of using the
# gmake default 'CC=c99', we use cc. # gmake default 'CC=c99', we use cc.
CC = cc # NOTE: Bear is used if available+executable (generate compile_commands.json)
CC = $$([ -x "$$(command -v bear)" ] && echo 'bear -- ') cc

View file

@ -19,12 +19,16 @@
pkgs.mkShell { pkgs.mkShell {
packages = with pkgs; packages = with pkgs;
[ [
# NativeBuildInputs # CryWL Build Utils
gnumake
bear
# DWL - NativeBuildInputs
installShellFiles installShellFiles
pkg-config pkg-config
wayland-scanner wayland-scanner
# BuildInputs # DWL - BuildInputs
libinput libinput
xorg.libxcb xorg.libxcb
libxkbcommon libxkbcommon
@ -35,7 +39,7 @@
] ]
++ lib.optionals enableXWayland ++ lib.optionals enableXWayland
[ [
# XWayland # DWL - XWayland
xorg.libX11 xorg.libX11
xorg.xcbutilwm xorg.xcbutilwm
xwayland xwayland