# **************************************************************************** # # # # :::::::: # # Makefile :+: :+: # # +:+ # # By: whaffman +#+ # # +#+ # # Created: 2024/10/10 16:44:36 by whaffman #+# #+# # # Updated: 2025/05/23 13:58:21 by whaffman ######## odam.nl # # # # **************************************************************************** # NAME = libft.a INC_DIR = inc OBJ_DIR = obj CC = cc WARNINGS = -Wall -Wextra -Werror -g #-fsanitize=address,undefined CFLAGS = $(WARNINGS) VPATH = src:src/conversion:src/ft_printf:src/list:src/memory:src/output:\ src/string:src/get_next_line:src/array SRC_ARRAY = ft_count_arr.c SRC_CONVERSION = ft_atoi.c ft_itoa.c ft_tolower.c ft_toupper.c \ SRC_MEMORY = ft_memchr.c ft_memcmp.c ft_memcpy.c ft_memmove.c ft_memset.c \ ft_bzero.c ft_calloc.c ft_free_arr.c SRC_STRING = ft_isalnum.c ft_isalpha.c ft_isascii.c ft_isdigit.c ft_isprint.c \ ft_split.c ft_strchr.c ft_strdup.c ft_striteri.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_strcmp.c \ ft_count_words.c ft_isspace.c ft_isdigit_str.c ft_strtok.c SRC_LIST = ft_lstadd_back.c ft_lstadd_front.c ft_lstclear.c ft_lstdelone.c \ ft_lstiter.c ft_lstlast.c ft_lstmap.c ft_lstnew.c ft_lstsize.c SRC_OUTPUT = ft_putchar_fd.c ft_putendl_fd.c ft_putnbr_fd.c ft_putstr_fd.c SRC_FT_PRINTF = ft_isbase.c ft_putnbr_base.c ft_write_str.c parse_placeholder.c \ print_hex.c print_pointer.c print_unumber.c ft_printf.c \ ft_putnbr_signed.c parse_conversion.c print_char.c \ print_number.c print_string.c SRC_GET_NEXT_LINE = get_next_line.c SOURCES = $(SRC_CONVERSION) $(SRC_MEMORY) $(SRC_STRING) \ $(SRC_LIST) $(SRC_OUTPUT) $(SRC_FT_PRINTF) \ $(SRC_GET_NEXT_LINE) $(SRC_ARRAY) OBJECTS = $(addprefix $(OBJ_DIR)/, $(SOURCES:.c=.o)) all: $(NAME) $(NAME): $(OBJECTS) $(AR) rcs $@ $^ $(OBJ_DIR): mkdir -p $@ $(OBJ_DIR)/%.o: %.c | $(OBJ_DIR) $(CC) $(CFLAGS) -I $(INC_DIR) -c $< -o $@ clean: rm -rf $(OBJ_DIR) fclean: clean rm -f $(NAME) re: fclean all debug: CFLAGS += -DDEBUG -g debug: $(NAME) .PHONY: all clean fclean re