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/dev | 24 +++++++++++++++++------- 1 file changed, 17 insertions(+), 7 deletions(-) (limited to 'shellrc.d/dev') 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