Makefile. header file and 4 functions

This commit is contained in:
David Gailleton
2025-11-05 11:13:34 +01:00
commit e06b98052a
7 changed files with 192 additions and 0 deletions

38
Makefile Normal file
View File

@@ -0,0 +1,38 @@
CC = cc
AR = ar
ARFLAGS = rc
CFLAGS = -Wall -Wextra -Werror -I libft.h
NAME = libft.a
SRC = ft_isalpha.c ft_isdigit.c ft_isalnum.c ft_isascii.c
OBJDIR = objs
OBJ = $(patsubst %, $(OBJDIR)/%o, $(SRC:.c=.))
all: $(NAME)
$(NAME): $(OBJ)
$(AR) $(ARFLAGS) $(NAME) $(OBJ)
ranlib $(NAME)
$(OBJDIR)/%.o: %.c | $(OBJDIR)
$(CC) -o $@ -c $< $(CFLAGS)
$(OBJDIR):
mkdir $@
clean:
rm -f $(OBJ)
fclean: clean
rm -f $(NAME)
re: fclean all
.PHONY: all clean fclean re