отлично работает либвт мейк и подрубил работу мейка принтфа

This commit is contained in:
Matthos Denys 2021-01-11 19:38:27 +03:00
parent ed3949df74
commit fde85d4712
38 changed files with 91 additions and 38 deletions

View File

@ -0,0 +1,53 @@
.PHONY: all clean fclean re
LIBFT = libft.a
NAME = libftprintf.a
SRCS = ft_printf.c ft_parser.c ft_parser_utils.c \
ft_put_c.c ft_put_d.c ft_put_d_utilc.c \
ft_put_p.c ft_put_s.c ft_put_u.c ft_put_x.c \
ft_put_u_included.c ft_put_u_utilc.c \
ft_put_x_included.c ft_put_x_utilc.c \
ft_put_p_included.c ft_put_p_utilc.c \
putmaket_utils.c ft_put_d_undersize.c
OBJ_DIR = ./obj/
CC = gcc
CFLAGS = -Wall -Wextra -Werror
OBJS = $(SRCS:%.c=%.o)
OBJS_FILES = $(addprefix $(OBJ_DIR), $(OBJS))
PATH_PUT_UTILS = put_d put_p put_u put_x
PATH_MAKER = $(addprefix srcs/putchar_maker/, $(PATH_PUT_UTILS))
vpath %.c srcs srcs/parser srcs/putchar_maker $(PATH_MAKER)
vpath %.a ./libft
all : $(NAME)
$(NAME): $(LIBFT) $(OBJS_FILES)
ar -rcs $(NAME) $(filter %.o, $^)
$(LIBFT): ./libft/src/*.c
$(MAKE) all -C ./libft
cp libft/libft.a $(NAME)
$(OBJ_DIR)%.o: %.c ft_printf.h
$(CC) $(CFLAGS) -I. -c $< -o $@
clean :
@$(MAKE) clean -C ./libft
rm -rf $(OBJS_FILES)
fclean : clean
make fclean -C ./libft
rm -rf $(NAME)
re : fclean all

View File

@ -6,7 +6,7 @@
/* By: mdenys <mdenys@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2020/11/19 16:50:07 by mdenys #+# #+# */
/* Updated: 2020/12/16 06:00:04 by mdenys ### ########.fr */
/* Updated: 2021/01/11 18:34:40 by mdenys ### ########.fr */
/* */
/* ************************************************************************** */
@ -14,7 +14,7 @@
# define FT_PRINTF_H
# include <stdarg.h>
# include "libft/libft.h"
# include "libft/includes/libft.h"
# include <stdlib.h>
typedef struct s_printf

View File

@ -1,6 +1,6 @@
.PHONY: all clean fclean re
SRCS = ft_isalnum.c ft_isprint.c ft_memcmp.c ft_putchar_fd.c ft_split.c \
SRCS = ft_isalnum.c ft_isprint.c ft_memcmp.c ft_putchar_fd.c ft_split.c \
ft_strlcat.c ft_strncmp.c ft_substr.c ft_atoi.c ft_isalpha.c \
ft_itoa.c ft_memcpy.c ft_putendl_fd.c ft_strchr.c ft_strlcpy.c \
ft_strnstr.c ft_tolower.c ft_bzero.c ft_isascii.c ft_memccpy.c \

View File

@ -6,7 +6,7 @@
/* By: mdenys <mdenys@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2020/11/19 16:46:57 by mdenys #+# #+# */
/* Updated: 2020/12/14 21:59:53 by mdenys ### ########.fr */
/* Updated: 2021/01/11 18:33:52 by mdenys ### ########.fr */
/* */
/* ************************************************************************** */

View File

@ -6,11 +6,11 @@
/* By: mdenys <mdenys@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2020/11/23 18:47:42 by mdenys #+# #+# */
/* Updated: 2020/12/16 05:50:42 by mdenys ### ########.fr */
/* Updated: 2021/01/11 18:35:27 by mdenys ### ########.fr */
/* */
/* ************************************************************************** */
#include "../ft_printf.h"
#include "ft_printf.h"
void szero(t_printf *params)
{

View File

@ -6,11 +6,11 @@
/* By: mdenys <mdenys@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2020/11/25 13:33:20 by mdenys #+# #+# */
/* Updated: 2020/12/16 05:48:22 by mdenys ### ########.fr */
/* Updated: 2021/01/11 18:35:04 by mdenys ### ########.fr */
/* */
/* ************************************************************************** */
#include "../ft_printf.h"
#include "ft_printf.h"
void printf_value(t_printf *list, int value)
{

View File

@ -6,11 +6,11 @@
/* By: mdenys <mdenys@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2020/12/02 09:51:16 by mdenys #+# #+# */
/* Updated: 2020/12/14 21:41:40 by mdenys ### ########.fr */
/* Updated: 2021/01/11 18:35:27 by mdenys ### ########.fr */
/* */
/* ************************************************************************** */
#include "../ft_printf.h"
#include "ft_printf.h"
int ft_put_c(t_printf *list, va_list *name)
{

View File

@ -6,11 +6,11 @@
/* By: mdenys <mdenys@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2020/12/02 09:51:16 by mdenys #+# #+# */
/* Updated: 2020/12/14 21:55:46 by mdenys ### ########.fr */
/* Updated: 2021/01/11 18:35:27 by mdenys ### ########.fr */
/* */
/* ************************************************************************** */
#include "../ft_printf.h"
#include "ft_printf.h"
void print_hep(t_printf *list, long int value)
{

View File

@ -6,11 +6,11 @@
/* By: mdenys <mdenys@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2020/12/02 09:51:16 by mdenys #+# #+# */
/* Updated: 2020/12/16 05:30:38 by mdenys ### ########.fr */
/* Updated: 2021/01/11 18:35:27 by mdenys ### ########.fr */
/* */
/* ************************************************************************** */
#include "../ft_printf.h"
#include "ft_printf.h"
int ft_prints(t_printf *list, char *value)
{

View File

@ -6,11 +6,11 @@
/* By: mdenys <mdenys@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2020/12/02 09:51:16 by mdenys #+# #+# */
/* Updated: 2020/12/16 00:57:51 by mdenys ### ########.fr */
/* Updated: 2021/01/11 18:35:27 by mdenys ### ########.fr */
/* */
/* ************************************************************************** */
#include "../ft_printf.h"
#include "ft_printf.h"
int ft_put_u(t_printf *list, va_list *name)
{

View File

@ -6,11 +6,11 @@
/* By: mdenys <mdenys@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2020/12/02 09:51:16 by mdenys #+# #+# */
/* Updated: 2020/12/16 02:03:54 by mdenys ### ########.fr */
/* Updated: 2021/01/11 18:35:27 by mdenys ### ########.fr */
/* */
/* ************************************************************************** */
#include "../ft_printf.h"
#include "ft_printf.h"
void print_hex(unsigned int value, t_printf *list)
{

View File

@ -6,11 +6,11 @@
/* By: mdenys <mdenys@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2020/12/02 09:51:16 by mdenys #+# #+# */
/* Updated: 2020/12/16 05:21:31 by mdenys ### ########.fr */
/* Updated: 2021/01/11 18:36:14 by mdenys ### ########.fr */
/* */
/* ************************************************************************** */
#include "../../ft_printf.h"
#include "ft_printf.h"
void d_iszero(t_printf *list, int value)
{

View File

@ -6,11 +6,11 @@
/* By: mdenys <mdenys@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2020/12/02 09:51:16 by mdenys #+# #+# */
/* Updated: 2020/12/16 05:22:28 by mdenys ### ########.fr */
/* Updated: 2021/01/11 18:36:14 by mdenys ### ########.fr */
/* */
/* ************************************************************************** */
#include "../../ft_printf.h"
#include "ft_printf.h"
void d_isleft(t_printf *list, int value)
{

View File

@ -6,11 +6,11 @@
/* By: mdenys <mdenys@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2020/12/02 09:51:16 by mdenys #+# #+# */
/* Updated: 2020/12/15 17:12:10 by mdenys ### ########.fr */
/* Updated: 2021/01/11 18:36:14 by mdenys ### ########.fr */
/* */
/* ************************************************************************** */
#include "../../ft_printf.h"
#include "ft_printf.h"
void for_diszero(t_printf *list, int value, int tmp, int c)
{

View File

@ -6,11 +6,11 @@
/* By: mdenys <mdenys@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2020/12/02 09:51:16 by mdenys #+# #+# */
/* Updated: 2020/12/16 05:55:32 by mdenys ### ########.fr */
/* Updated: 2021/01/11 18:36:14 by mdenys ### ########.fr */
/* */
/* ************************************************************************** */
#include "../../ft_printf.h"
#include "ft_printf.h"
void p_isleft(t_printf *list, long int value)
{

View File

@ -6,11 +6,11 @@
/* By: mdenys <mdenys@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2020/12/02 09:51:16 by mdenys #+# #+# */
/* Updated: 2020/12/16 05:26:52 by mdenys ### ########.fr */
/* Updated: 2021/01/11 18:36:14 by mdenys ### ########.fr */
/* */
/* ************************************************************************** */
#include "../../ft_printf.h"
#include "ft_printf.h"
int p_counter(t_printf *list, long int value)
{

View File

@ -6,11 +6,11 @@
/* By: mdenys <mdenys@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2020/12/02 09:51:16 by mdenys #+# #+# */
/* Updated: 2020/12/16 05:28:39 by mdenys ### ########.fr */
/* Updated: 2021/01/11 18:36:14 by mdenys ### ########.fr */
/* */
/* ************************************************************************** */
#include "../../ft_printf.h"
#include "ft_printf.h"
void u_isleft(t_printf *list, unsigned int value)
{

View File

@ -6,11 +6,11 @@
/* By: mdenys <mdenys@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2020/12/02 09:51:16 by mdenys #+# #+# */
/* Updated: 2020/12/16 05:29:15 by mdenys ### ########.fr */
/* Updated: 2021/01/11 18:36:14 by mdenys ### ########.fr */
/* */
/* ************************************************************************** */
#include "../../ft_printf.h"
#include "ft_printf.h"
void for_uiszero(t_printf *list, unsigned int value, int tmp, unsigned int c)
{

View File

@ -6,11 +6,11 @@
/* By: mdenys <mdenys@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2020/12/02 09:51:16 by mdenys #+# #+# */
/* Updated: 2020/12/16 05:15:12 by mdenys ### ########.fr */
/* Updated: 2021/01/11 18:36:14 by mdenys ### ########.fr */
/* */
/* ************************************************************************** */
#include "../../ft_printf.h"
#include "ft_printf.h"
void x_isleft(t_printf *list, unsigned int value)
{

View File

@ -6,11 +6,11 @@
/* By: mdenys <mdenys@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2020/12/02 09:51:16 by mdenys #+# #+# */
/* Updated: 2020/12/16 05:30:04 by mdenys ### ########.fr */
/* Updated: 2021/01/11 18:36:14 by mdenys ### ########.fr */
/* */
/* ************************************************************************** */
#include "../../ft_printf.h"
#include "ft_printf.h"
void for_xiszero(t_printf *list, unsigned int value, int tmp, unsigned int c)
{

View File

@ -6,11 +6,11 @@
/* By: mdenys <mdenys@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2020/12/02 09:51:16 by mdenys #+# #+# */
/* Updated: 2020/12/16 05:39:25 by mdenys ### ########.fr */
/* Updated: 2021/01/11 18:35:27 by mdenys ### ########.fr */
/* */
/* ************************************************************************** */
#include "../ft_printf.h"
#include "ft_printf.h"
void ft_putnbr_fd_count(t_printf *list, long int n, int fd)
{