# **************************************************************************** # # # # ::: :::::::: # # Makefile :+: :+: :+: # # +:+ +:+ +:+ # # By: cacharle +#+ +:+ +#+ # # +#+#+#+#+#+ +#+ # # Created: 2019/10/28 17:41:14 by cacharle #+# #+# # # Updated: 2019/10/29 23:00:05 by cacharle ### ########.fr # # # # **************************************************************************** # LIBFT_ROOT = ./libft CC = gcc CCFLAGS = -Wall -Wextra -g #-Werror LDFLAGS = -L. -lftprintf INCFLAGS = -I$(LIBFT_ROOT) RM = rm -f LIB = ar rcs MAKE = make -j4 NAME = libftprintf.a SRC = ft_printf.c utils.c printer.c parse.c list.c extract.c \ convert_int.c convert_uint.c convert_char.c convert_str.c \ convert_ptr.c convert_hex_low.c convert_hex_up.c convert_percent.c OBJ = $(SRC:.c=.o) INCLUDE = header.h all: libft_all $(NAME) $(NAME): $(OBJ) cp $(LIBFT_ROOT)/libft.a $(NAME) $(LIB) $(NAME) $(OBJ) %.o: %.c $(INCLUDE) $(CC) $(CCFLAGS) $(INCFLAGS) -c -o $@ $< bonus: all clean: libft_clean $(RM) $(OBJ) fclean: libft_fclean clean $(RM) $(NAME) re: fclean all test: all $(CC) $(CCFLAGS) $(LDFLAGS) -L./libft -lft $(INCFLAGS) -o test main.c libft_all: $(MAKE) -C $(LIBFT_ROOT) all libft_bonus: $(MAKE) -C $(LIBFT_ROOT) bonus libft_clean: $(MAKE) -C $(LIBFT_ROOT) clean libft_fclean: $(MAKE) -C $(LIBFT_ROOT) fclean