1
0

updated libft

This commit is contained in:
2024-03-12 14:34:46 +01:00
parent 63a5504b82
commit 434b39969d
4 changed files with 26 additions and 23 deletions

View File

@ -6,7 +6,7 @@
# By: adjoly <adjoly@student.42angouleme.fr> +#+ +:+ +#+ # # By: adjoly <adjoly@student.42angouleme.fr> +#+ +:+ +#+ #
# +#+#+#+#+#+ +#+ # # +#+#+#+#+#+ +#+ #
# Created: 2023/11/01 11:03:22 by adjoly #+# #+# # # Created: 2023/11/01 11:03:22 by adjoly #+# #+# #
# Updated: 2024/02/15 13:55:20 by adjoly ### ########.fr # # Updated: 2024/03/04 13:39:42 by adjoly ### ########.fr #
# # # #
# **************************************************************************** # # **************************************************************************** #
@ -14,6 +14,8 @@ NAME = libft.a
CC = cc CC = cc
OBJSDIR = obj/
SRCS = is/ft_isalnum.c \ SRCS = is/ft_isalnum.c \
is/ft_isalpha.c \ is/ft_isalpha.c \
is/ft_isascii.c \ is/ft_isascii.c \
@ -69,34 +71,32 @@ SRCS = is/ft_isalnum.c \
print/printf/ft_putnbr.c \ print/printf/ft_putnbr.c \
print/printf/ft_putstr.c \ print/printf/ft_putstr.c \
OBJS = $(SRCS:.c=.o) OBJS = $(addprefix $(OBJSDIR),$(SRCS:.c=.o))
FLAGS = -Werror -Wall -Wextra -g FLAGS = -Werror -Wall -Wextra -g
HEADERS = libft.h HEADERS = libft.h
LIB = print/printf/libftprintf.a \ LIB = io/get_next_line/get_next_line.a
io/get_next_line/get_next_line.a
$(NAME): $(OBJS) $(NAME): $(OBJS)
make -C io/get_next_line/ @make -s -C io/get_next_line/
make -C print/printf/ @ar -rcs $(NAME) $(OBJS) $(LIB)
ar -rcs $(NAME) $(OBJS) $(LIB) @echo "[✔] Libft compiled"
%.o: %.c $(OBJSDIR)%.o: %.c
$(CC) $(FLAGS) -I $(HEADERS) $< -c -o $@ @mkdir -p $(@D)
@$(CC) $(FLAGS) -I $(HEADERS) $< -c -o $@
all: $(NAME) all: $(NAME)
clean: clean:
make -C io/get_next_line/ clean @make -s -C io/get_next_line/ clean
make -C print/printf clean @rm -f $(OBJS)
rm -f $(OBJS)
fclean: clean fclean: clean
make -C io/get_next_line/ fclean @make -s -C io/get_next_line/ fclean
make -C print/printf/ fclean @rm -f $(NAME)
rm -f $(NAME)
re: fclean all re: fclean all

View File

@ -6,7 +6,7 @@
# By: adjoly <adjoly@student.42angouleme.fr> +#+ +:+ +#+ # # By: adjoly <adjoly@student.42angouleme.fr> +#+ +:+ +#+ #
# +#+#+#+#+#+ +#+ # # +#+#+#+#+#+ +#+ #
# Created: 2023/11/01 11:03:22 by adjoly #+# #+# # # Created: 2023/11/01 11:03:22 by adjoly #+# #+# #
# Updated: 2024/02/04 14:54:32 by adjoly ### ########.fr # # Updated: 2024/03/04 13:30:36 by adjoly ### ########.fr #
# # # #
# **************************************************************************** # # **************************************************************************** #
@ -26,18 +26,18 @@ FLAGS = -Werror -Wall -Wextra
HEADER = get_next_line.h HEADER = get_next_line.h
$(NAME): $(OBJS) $(NAME): $(OBJS)
ar -rcs $(NAME) $(OBJS) @ar -rcs $(NAME) $(OBJS)
%.o: %.c %.o: %.c
$(CC) $(FLAGS) -I $(HEADER) $< -c -o $@ @$(CC) $(FLAGS) -I $(HEADER) $< -c -o $@
all: $(NAME) all: $(NAME)
clean: clean:
rm -f $(OBJS) @rm -f $(OBJS)
fclean: clean fclean: clean
rm -f $(NAME) @rm -f $(NAME)
re: fclean all re: fclean all

View File

@ -6,7 +6,7 @@
/* By: adjoly <adjoly@student.42angouleme.fr> +#+ +:+ +#+ */ /* By: adjoly <adjoly@student.42angouleme.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */ /* +#+#+#+#+#+ +#+ */
/* Created: 2023/11/01 10:06:03 by adjoly #+# #+# */ /* Created: 2023/11/01 10:06:03 by adjoly #+# #+# */
/* Updated: 2024/02/22 11:29:58 by adjoly ### ########.fr */ /* Updated: 2024/03/04 09:06:35 by adjoly ### ########.fr */
/* */ /* */
/* ************************************************************************** */ /* ************************************************************************** */
@ -20,6 +20,9 @@
# include "print/printf/ft_printf.h" # include "print/printf/ft_printf.h"
# include "io/get_next_line/get_next_line.h" # include "io/get_next_line/get_next_line.h"
# define INT_MAX 2147483647
# define INT_MIN -2147483648
typedef struct s_list typedef struct s_list
{ {
void *content; void *content;

View File

@ -6,7 +6,7 @@
/* By: adjoly <adjoly@student.42angouleme.fr> +#+ +:+ +#+ */ /* By: adjoly <adjoly@student.42angouleme.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */ /* +#+#+#+#+#+ +#+ */
/* Created: 2023/11/01 16:02:26 by adjoly #+# #+# */ /* Created: 2023/11/01 16:02:26 by adjoly #+# #+# */
/* Updated: 2024/02/04 14:22:20 by adjoly ### ########.fr */ /* Updated: 2024/03/04 10:10:58 by adjoly ### ########.fr */
/* */ /* */
/* ************************************************************************** */ /* ************************************************************************** */
@ -14,7 +14,7 @@
void *ft_calloc(size_t nmemb, size_t size) void *ft_calloc(size_t nmemb, size_t size)
{ {
char *result; void *result;
size_t i; size_t i;
i = 0; i = 0;