명령어 등등

makefile -fsanitize=address 위치

mcdn 2021. 7. 5. 19:38
반응형
# **************************************************************************** #
#                                                                              #
#                                                         :::      ::::::::    #
#    Makefile                                           :+:      :+:    :+:    #
#                                                     +:+ +:+         +:+      #
#    By: selim <selim@student.42seoul.kr>           +#+  +:+       +#+         #
#                                                 +#+#+#+#+#+   +#+            #
#    Created: 2021/06/28 14:08:12 by selim             #+#    #+#              #
#    Updated: 2021/07/05 19:37:20 by selim            ###   ########.fr        #
#                                                                              #
# **************************************************************************** #

NAME =  philo_bonus
SRC	 =  main_bonus.c \
		utils_bonus.c \
		ft_libft_bonus.c \
		start_philo_bonus.c \
		running_bonus.c

OBJ_NAME  = $(SRC:.c=.o)
OBJ_PATH = ./obj
OBJ = $(addprefix $(OBJ_PATH)/, $(OBJ_NAME))
CLANG = -Wall -Werror -Wextra

all : $(NAME)

$(NAME): $(OBJ)
	gcc $(CLANG) $^ -o $@ -fsanitize=address

$(OBJ_PATH)/%.o : %.c
	mkdir ./obj 2> /dev/null || true
	gcc $(CLANG) -o $@ -c $<

re : fclean all

clean :
	rm -rf $(OBJ_NAME)
	rm -rf $(OBJ_PATH)

fclean : clean
	rm -rf $(NAME)
반응형