aboutsummaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorDominik Kaiser2024-06-25 13:03:28 +0200
committerGitHub2024-06-25 13:03:28 +0200
commit0d7a57a7bc14831d6d7076ccb0ea7a7213ddd7fb (patch)
treeb32a1e9f885ec813cd8b729c05db2ba2a68f9475 /Makefile
parent1d8f996fe098b7399669174b67d2fa6341bea8d7 (diff)
downloadminishell-0d7a57a7bc14831d6d7076ccb0ea7a7213ddd7fb.tar.gz
minishell-0d7a57a7bc14831d6d7076ccb0ea7a7213ddd7fb.zip
Add debug tools
* Add dbg() function and debug make rule * Add panic() debug function
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile12
1 files changed, 10 insertions, 2 deletions
diff --git a/Makefile b/Makefile
index fb679ae..6fe15b6 100644
--- a/Makefile
+++ b/Makefile
@@ -11,7 +11,7 @@ LIBS = -L $(LIB_DIR)/libft -lft
HEADERS = -I include -I $(LIB_DIR)/libft
VPATH := src
-SRC := main.c
+SRC := main.c debug_tools.c
OBJ_DIR := _obj
OBJ := $(addprefix $(OBJ_DIR)/, $(SRC:%.c=%.o))
@@ -51,7 +51,15 @@ fclean: clean
re: fclean all
-.PHONY: all clean fclean re libs
+debug: CFLAGS += -g
+debug: CFLAGS += -fsanitize=address -fsanitize=undefined \
+ -fno-sanitize-recover=all -fsanitize=float-divide-by-zero \
+ -fsanitize=float-cast-overflow -fno-sanitize=null \
+ -fno-sanitize=alignment
+debug: CFLAGS += -DDEBUG=1
+debug: clean all
+
+.PHONY: all clean fclean re libs debug
################################################################################
################################################################################