# **************************************************************************** #
#                                                                              #
#                                                         :::      ::::::::    #
#    Makefile                                           :+:      :+:    :+:    #
#                                                     +:+ +:+         +:+      #
#    By: apommier <apommier@student.42.fr>          +#+  +:+       +#+         #
#                                                 +#+#+#+#+#+   +#+            #
#    Created: 2021/11/13 13:06:47 by apommier          #+#    #+#              #
#    Updated: 2022/01/19 03:50:25 by apommier         ###   ########.fr        #
#                                                                              #
# **************************************************************************** #

NAME	= push_swap checker
SRCS	= Utils/push_swap.c \
			Utils/process.c\
			main.c\
			Utils/sorting.c\
			Utils/t_slist.c\
			Utils/set_a.c\
			Utils/sort_little.c\
			Utils/optimise_move.c\
			Utils/optimise_move2.c\
			Utils/indexing.c
OBJS	= ${SRCS:.c=.o}
BONUS_C	= checker_folder/main.c\
			checker_folder/checker_utils.c\
			checker_folder/checker_process.c\
			Utils/push_swap.c \
			Utils/process.c\
			Utils/sorting.c\
			Utils/t_slist.c\
			Utils/set_a.c\
			Utils/sort_little.c\
			Utils/optimise_move.c\
			Utils/optimise_move2.c\
			Utils/indexing.c
BONUS_O	= ${BONUS_C:.c=.o}
CFLAGS	= -Wall -Wextra -Werror
RM		= rm -rf
LIBFT	= ./libft


${NAME}:${OBJS} 
		make bonus -C ${LIBFT}
		gcc -g  ${OBJS} ${LIBFT}/libft.a
		mv a.out push_swap

bonus:${BONUS_O}
		make bonus -C ${LIBFT}
		gcc -g ${CFLAGS} ${BONUS_O} ${LIBFT}/libft.a 
		mv a.out checker

all:	${NAME}

clean:
		${RM} ${OBJS}
		${RM} ${BONUS_O}
		make clean -C ${LIBFT}

fclean:	clean
		${RM} ${NAME}
		make fclean -C ${LIBFT}
		
re: 	fclean all

.PHONY: all clean fclean re bonus 

