From e3eadc3a5b85b3c97b7ff5504808ef73ea1c7e2a Mon Sep 17 00:00:00 2001 From: Aaron Ball Date: Tue, 21 Jun 2022 20:51:36 -0600 Subject: Makefile:Add valgrind target This is set up to check for memory leaks verbosely, as well as notify of leaked file descriptors. --- Makefile | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/Makefile b/Makefile index 4af7f0b..52f5602 100644 --- a/Makefile +++ b/Makefile @@ -7,3 +7,11 @@ all: cc $(CCOPTS) -o obj/proc.o -c src/proc.c cc $(CCOPTS) -o obj/status.o -c src/status.c cc $(CCOPTS) -o cmon obj/*.o src/main.c + +valgrind: all + $(info Running memory leak check) + valgrind \ + --leak-check=full \ + --show-leak-kinds=all \ + --error-exitcode=1 \ + ./cmon -- cgit v1.2.3