NAME = libft.a

CC = gcc

FLAGS    = -Wall -Wextra -Werror

DEL = /bin/rm -f

SRCS =     ft_atoi.c \
        ft_bzero.c \
        ft_calloc.c \
        ft_isalnum.c \
        ft_isalpha.c \
        ft_isascii.c \
        ft_isdigit.c \
        ft_isprint.c \
        ft_itoa.c \
        ft_memccpy.c \
        ft_memchr.c \
        ft_memcmp.c \
        ft_memcpy.c \
        ft_memmove.c \
        ft_memset.c \
        ft_split.c \
        ft_strchr.c \
        ft_strdup.c \
        ft_strjoin.c \
        ft_strlcat.c \
        ft_strlcpy.c \
        ft_strlen.c \
        ft_strmapi.c \
        ft_strncmp.c \
        ft_strnstr.c \
        ft_strrchr.c \
        ft_strtrim.c \
        ft_substr.c \
        ft_putchar_fd.c \
        ft_putstr_fd.c \
        ft_putendl_fd.c \
        ft_putnbr_fd.c \
        ft_tolower.c \
        ft_toupper.c \

BONUS =	ft_lstnew.c \
        ft_lstsize.c \
        ft_lstlast.c \
        ft_lstadd_front.c \
        ft_lstadd_back.c \
        ft_lstdelone.c \
        ft_lstiter.c \
        ft_lstmap.c \
        ft_lstclear.c \
				ft_putchar.c \
				ft_putstr.c \
				ft_strcmp.c \

SRCS_O    = ${SRCS:.c=.o}
BONUS_O        = ${BONUS:.c=.o}
all: $(NAME)

LIBC    = ar -rcs

%.o: %.c
		${CC} ${FLAGS} -c $< -o ${<:.c=.o}

$(NAME): ${SRCS_O}
			${LIBC} $(NAME) $(SRCS_O)

bonus: $(SRCS_O) $(BONUS_O)
		$(LIBC) $(NAME) $(SRCS_O) $(BONUS_O)

fclean: clean
		$(DEL) $(NAME)

clean:
		$(DEL) $(SRCS_O) $(BONUS_O)

re: fclean all
