aboutsummaryrefslogtreecommitdiff
path: root/shellrc.d
diff options
context:
space:
mode:
authorKarel Kočí <cynerd@email.cz>2023-02-23 11:39:37 +0100
committerKarel Kočí <cynerd@email.cz>2023-02-23 11:39:37 +0100
commit6f8f27349e074f2c9b6e7a359dad4f5656fc9db8 (patch)
tree38a8acdefce447ec4b9697f2bee891232470bd5a /shellrc.d
parent6a755147b903324a0a5a481a631fa0a8082cad12 (diff)
downloadshellrc-6f8f27349e074f2c9b6e7a359dad4f5656fc9db8.tar.gz
shellrc-6f8f27349e074f2c9b6e7a359dad4f5656fc9db8.tar.bz2
shellrc-6f8f27349e074f2c9b6e7a359dad4f5656fc9db8.zip
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.
Diffstat (limited to 'shellrc.d')
-rw-r--r--shellrc.d/alias2
-rw-r--r--shellrc.d/dev24
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