2024-04-24 10:53:46 +02:00
|
|
|
# **************************************************************************** #
|
|
|
|
# #
|
|
|
|
# ::: :::::::: #
|
|
|
|
# Makefile :+: :+: :+: #
|
|
|
|
# +:+ +:+ +:+ #
|
2024-04-29 13:53:00 +02:00
|
|
|
# By: mmoussou <mmoussou@student.42angouleme.fr +#+ +:+ +#+ #
|
2024-04-24 10:53:46 +02:00
|
|
|
# +#+#+#+#+#+ +#+ #
|
2024-04-29 13:53:00 +02:00
|
|
|
# Created: 2024/01/22 07:21:18 by mmoussou #+# #+# #
|
2024-06-03 15:49:39 +02:00
|
|
|
# Updated: 2024/06/03 15:42:56 by mmoussou ### ########.fr #
|
2024-04-24 10:53:46 +02:00
|
|
|
# #
|
|
|
|
# **************************************************************************** #
|
|
|
|
|
2024-04-29 13:53:00 +02:00
|
|
|
SHELL = bash
|
2024-04-24 10:53:46 +02:00
|
|
|
|
2024-06-03 15:49:39 +02:00
|
|
|
CC = cc
|
2024-04-24 10:53:46 +02:00
|
|
|
|
2024-05-13 17:33:29 +02:00
|
|
|
CFLAGS = -Wall -Werror -Wextra -pipe -fPIE
|
2024-04-24 10:53:46 +02:00
|
|
|
|
2024-04-29 13:53:00 +02:00
|
|
|
INCLUDE = ./include
|
2024-04-24 10:53:46 +02:00
|
|
|
|
2024-04-29 13:53:00 +02:00
|
|
|
NAME = libft.a
|
2024-04-24 10:53:46 +02:00
|
|
|
|
2024-04-29 13:53:00 +02:00
|
|
|
#find -type f -name "*.c" | sed "s/\.\///g" | xargs -Iname echo "`printf '\t\t\t'`" name "\\"
|
|
|
|
SRCS = src/io/ft_putnbr_fd.c \
|
|
|
|
src/io/ft_putuhex_fd.c \
|
|
|
|
src/io/ft_putendl_fd.c \
|
|
|
|
src/io/ft_putstr_fd.c \
|
|
|
|
src/io/ft_printf.c \
|
|
|
|
src/io/ft_printf_fd.c \
|
|
|
|
src/io/ft_putchar_fd.c \
|
2024-05-25 14:29:30 +02:00
|
|
|
src/io/get_next_line/get_next_line.c \
|
2024-04-29 13:53:00 +02:00
|
|
|
\
|
|
|
|
src/int/ft_min.c \
|
|
|
|
src/int/ft_max.c \
|
|
|
|
src/int/ft_abs.c \
|
|
|
|
\
|
|
|
|
src/mem/ft_memchr.c \
|
|
|
|
src/mem/ft_calloc.c \
|
|
|
|
src/mem/ft_memcpy.c \
|
|
|
|
src/mem/ft_free.c \
|
|
|
|
src/mem/ft_memset.c \
|
|
|
|
src/mem/ft_memcmp.c \
|
|
|
|
src/mem/ft_memmove.c \
|
|
|
|
src/mem/ft_bzero.c \
|
|
|
|
\
|
|
|
|
src/str/XtoX/ft_atol.c \
|
|
|
|
src/str/XtoX/ft_itoa.c \
|
|
|
|
src/str/XtoX/ft_atoi.c \
|
|
|
|
src/str/XtoX/ft_ltoa.c \
|
|
|
|
\
|
|
|
|
src/str/ft_strchr.c \
|
|
|
|
src/str/ft_strtrim.c \
|
|
|
|
src/str/ft_strcmp.c \
|
|
|
|
src/str/ft_striteri.c \
|
|
|
|
src/str/ft_strmapi.c \
|
|
|
|
src/str/ft_substr.c \
|
|
|
|
src/str/ft_strdup.c \
|
|
|
|
src/str/ft_strnstr.c \
|
|
|
|
src/str/ft_tolower.c \
|
|
|
|
src/str/ft_strlcpy.c \
|
|
|
|
src/str/ft_strlen.c \
|
|
|
|
src/str/ft_strjoin.c \
|
|
|
|
src/str/ft_strncmp.c \
|
|
|
|
src/str/ft_strrchr.c \
|
|
|
|
src/str/ft_split.c \
|
|
|
|
src/str/ft_strlcat.c \
|
|
|
|
src/str/ft_toupper.c \
|
|
|
|
\
|
|
|
|
src/char/ft_isdigit.c \
|
|
|
|
src/char/ft_isalnum.c \
|
|
|
|
src/char/ft_isprint.c \
|
|
|
|
src/char/ft_isalpha.c \
|
|
|
|
src/char/ft_isascii.c \
|
|
|
|
\
|
|
|
|
src/stack/ft_stackadd_front.c \
|
|
|
|
src/stack/ft_stackadd_back.c \
|
|
|
|
src/stack/ft_stacksize.c \
|
|
|
|
src/stack/ft_stacknew.c \
|
|
|
|
src/stack/ft_stacklast.c \
|
|
|
|
\
|
|
|
|
src/linked_lists/ft_lstmap.c \
|
|
|
|
src/linked_lists/ft_lstnew.c \
|
|
|
|
src/linked_lists/ft_lstclear.c \
|
|
|
|
src/linked_lists/ft_lstsize.c \
|
|
|
|
src/linked_lists/ft_lstadd_front.c \
|
|
|
|
src/linked_lists/ft_lstadd_back.c \
|
|
|
|
src/linked_lists/ft_lstiter.c \
|
|
|
|
src/linked_lists/ft_lstlast.c \
|
|
|
|
src/linked_lists/ft_lstdelone.c
|
2024-04-24 10:53:46 +02:00
|
|
|
|
2024-04-29 13:53:00 +02:00
|
|
|
OBJS = $(SRCS:.c=.o)
|
2024-04-24 10:53:46 +02:00
|
|
|
|
|
|
|
|
|
|
|
all: $(NAME)
|
|
|
|
|
2024-04-29 13:53:00 +02:00
|
|
|
%.o: %.c
|
2024-06-03 15:49:39 +02:00
|
|
|
@printf "\x1B[2K\r \x1B[1;32m[ ]\x1B[0m compiling libft objects... : $<"
|
2024-04-29 13:53:00 +02:00
|
|
|
@$(CC) $(CFLAGS) -I$(INCLUDE) $< -c -o $@
|
|
|
|
|
|
|
|
$(NAME): $(OBJS)
|
2024-06-03 15:49:39 +02:00
|
|
|
@printf "\x1B[2K\r \x1B[1;32m[ ]\x1B[0m libft objects compiled."
|
|
|
|
@printf "\n \x1B[1;33m[ ]\x1B[0m creating libft archive..."
|
2024-04-29 13:53:00 +02:00
|
|
|
@ar rcs $(NAME) $(OBJS)
|
2024-06-03 15:49:39 +02:00
|
|
|
@printf "\x1B[2K\r \x1B[1;33m[ ]\x1B[0m libft archive created.\n"
|
2024-04-29 13:53:00 +02:00
|
|
|
|
|
|
|
clean:
|
2024-04-24 10:53:46 +02:00
|
|
|
@rm -f $(OBJS)
|
2024-06-03 15:49:39 +02:00
|
|
|
@printf " \x1B[1;31m[ ]\x1B[0m deleted libft objects.\n"
|
2024-04-24 10:53:46 +02:00
|
|
|
|
|
|
|
fclean: clean
|
|
|
|
@rm -f $(NAME)
|
2024-06-03 15:49:39 +02:00
|
|
|
@printf " \x1B[1;31m[ ]\x1B[0m deleted libft archive.\n"
|
2024-04-24 10:53:46 +02:00
|
|
|
|
|
|
|
re: fclean all
|
|
|
|
|
2024-06-03 15:49:39 +02:00
|
|
|
.PHONY: all clean fclean re
|