From 6f8f27349e074f2c9b6e7a359dad4f5656fc9db8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Karel=20Ko=C4=8D=C3=AD?= Date: Thu, 23 Feb 2023 11:39:37 +0100 Subject: dev: dump compile database with bmake to build directory This fixes issue when multiple projects are in the same tree as ALE locates this file first but we preffer to use the one in build directory located as soo as possible. --- shellrc.d/alias | 2 -- shellrc.d/dev | 24 +++++++++++++++++------- 2 files changed, 17 insertions(+), 9 deletions(-) diff --git a/shellrc.d/alias b/shellrc.d/alias index 0e2b616..f9a60e4 100644 --- a/shellrc.d/alias +++ b/shellrc.d/alias @@ -16,8 +16,6 @@ alias watch='watch -n 1 -c -t -d' alias rej='find -name \*.rej' alias orig='find -name \*.orig' alias mmake='make -j$(($(nproc) * 2)) -l$(nproc)' -alias bmake='bear --append -- make' -alias mbmake='bmake -j$(($(nproc) * 2)) -l$(nproc)' # Systemd aliases if we are running systemd if pidof systemd >/dev/null 2>/dev/null; then diff --git a/shellrc.d/dev b/shellrc.d/dev index 5f48285..fe365e3 100644 --- a/shellrc.d/dev +++ b/shellrc.d/dev @@ -1,14 +1,12 @@ # vim: ft=sh: + if command -v valgrind >/dev/null; then -memcheck() { - valgrind --track-fds=yes --leak-check=full --track-origins=yes "$@" -} - -massif() { - valgrind --tool=massif "$@" -} + alias memcheck="valgrind --track-fds=yes --leak-check=full --track-origins=yes" + alias massif="valgrind --tool=massif" + alias drd="valgrind --tool=drd" + alias helgrind="valgrind --tool=helgrind" fi @@ -44,3 +42,15 @@ mdist() { } fi + + +if command -v bear >/dev/null; then + + bmake() { + mkdir -p build + bear --output build/compile_commands.json --append -- make "$@" + } + + alias mbmake='bmake -j$(($(nproc) * 2)) -l$(nproc)' + +fi -- cgit v1.2.3