Skip to content

Commit

Permalink
add leak rule to Makefile
Browse files Browse the repository at this point in the history
  • Loading branch information
rask24 committed Jan 22, 2024
1 parent 8aa1568 commit b1f5c58
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 5 deletions.
11 changes: 9 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ NAME = push_swap
CFLAGS = -Werror -Wextra -Wall
CXXFLAGS = -std=c++17 -Wall -Wextra -Werror
PROD_FLAGS = -O3
DEV_FLAGS = -g -O0 -D DEV
DEV_FLAGS = -g -fsanitize=address -O0 -D DEV
LEAK_FLAGS = -O0 -D DEV -D LEAK
INCLUDE = -I $(INC_DIR)

SRC_DIR = src
Expand Down Expand Up @@ -85,6 +86,12 @@ dev: $(NAME)

redev: fclean dev

leak: CFLAGS += $(LEAK_FLAGS)
leak: title
leak: $(NAME)

releak: fclean leak

test: all $(GTEST_DIR) $(TEST_OBJ) $(GTEST_OBJ)
@echo "test"
$(CXX) -L $(LIBFT_DIR) -lft -lpthread $(OBJ_FILTER_MAIN) $(TEST_OBJ) $(GTEST_OBJ) -o $(TEST_NAME)
Expand Down Expand Up @@ -116,6 +123,6 @@ norm:
title:
@echo "$(BLUE)push_swap$(RESET)"

.PHONY: all clean fclean re dev test norm title
.PHONY: all clean fclean re dev redev leak releak test norm title

-include $(DEP)
7 changes: 4 additions & 3 deletions src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,13 @@
/* By: reasuke <[email protected]> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2024/01/10 12:37:36 by reasuke #+# #+# */
/* Updated: 2024/01/22 13:52:02 by reasuke ### ########.fr */
/* Updated: 2024/01/22 15:36:13 by reasuke ### ########.fr */
/* */
/* ************************************************************************** */

#include "push_swap.h"

#ifdef DEV

#ifdef LEAK
# ifdef __APPLE__

__attribute__((destructor))
Expand All @@ -23,6 +22,8 @@ void destructor(void)
}

# endif
#endif
#ifdef DEV

void put_void(void *content)
{
Expand Down

0 comments on commit b1f5c58

Please sign in to comment.