base c lib without external lib

This commit is contained in:
David Gailleton
2025-11-05 19:25:22 +01:00
parent e06b98052a
commit 697e044d7e
19 changed files with 445 additions and 13 deletions

View File

@@ -4,15 +4,37 @@ AR = ar
ARFLAGS = rc
CFLAGS = -Wall -Wextra -Werror -I libft.h
HEADER = libft.h
CFLAGS = -Wall -Wextra -Werror
NAME = libft.a
SRC = ft_isalpha.c ft_isdigit.c ft_isalnum.c ft_isascii.c
SRC = ft_isalpha.c \
ft_isdigit.c \
ft_isalnum.c \
ft_isascii.c \
ft_isprint.c \
ft_strlen.c \
ft_memset.c \
ft_bzero.c \
ft_memcpy.c \
ft_memmove.c \
ft_strlcpy.c \
ft_strlcat.c \
ft_toupper.c \
ft_tolower.c \
ft_strchr.c \
ft_strrchr.c \
ft_strncmp.c \
ft_memcpy.c \
ft_memchr.c \
ft_strnstr.c \
ft_atoi.c
OBJDIR = objs
OBJ_DIR = objs
OBJ = $(patsubst %, $(OBJDIR)/%o, $(SRC:.c=.))
OBJ = $(patsubst %, $(OBJ_DIR)/%o, $(SRC:.c=.))
all: $(NAME)
@@ -21,10 +43,10 @@ $(NAME): $(OBJ)
$(AR) $(ARFLAGS) $(NAME) $(OBJ)
ranlib $(NAME)
$(OBJDIR)/%.o: %.c | $(OBJDIR)
$(CC) -o $@ -c $< $(CFLAGS)
$(OBJ_DIR)/%.o: %.c | $(OBJ_DIR)
$(CC) -o $@ -c $< $(CFLAGS) -I$(HEADER)
$(OBJDIR):
$(OBJ_DIR):
mkdir $@
clean:
@@ -35,4 +57,4 @@ fclean: clean
re: fclean all
.PHONY: all clean fclean re
.PHONY: all clean fclean re