diff --git a/Makefile b/Makefile index 27274c7..2893bd0 100644 --- a/Makefile +++ b/Makefile @@ -6,7 +6,7 @@ # By: tmaze +#+ +:+ +#+ # # +#+#+#+#+#+ +#+ # # Created: 2018/04/07 12:47:06 by tmaze #+# #+# # -# Updated: 2019/02/27 12:46:59 by tmaze ### ########.fr # +# Updated: 2019/02/28 14:33:03 by tmaze ### ########.fr # # # #******************************************************************************# @@ -21,17 +21,22 @@ SRCS = ft_memset.c ft_bzero.c ft_memcpy.c ft_memccpy.c ft_memmove.c ft_memchr.c ft_lstnew.c ft_lstdelone.c ft_lstdel.c ft_lstadd.c ft_lstiter.c ft_lstmap.c \ ft_isupper.c ft_islower.c ft_str_is_alpha.c ft_str_is_lowercase.c ft_str_is_numeric.c ft_str_is_printable.c ft_str_is_uppercase.c ft_strcapitalize.c ft_strlcpy.c ft_strlowcase.c ft_strupcase.c ft_lstsize.c ft_lstgetat.c ft_lstgetlast.c ft_sort_params.c ft_print_words_tables.c ft_lstaddend.c ft_strndup.c ft_abs.c ft_strnchr.c ft_strrnchr.c get_next_line.c ft_del_words_tables.c ft_putstrn.c ft_nbrlen.c ft_putstrpad.c ft_putnbrpad.c ft_lstsort.c ft_lstaddsort.c ft_round.c ft_realpath.c ft_iswhitespace.c ft_issign.c ft_hasdigit.c ft_strsplitwhitespace.c ft_atois.c -OBJS = $(SRCS:.c=.o) +OBJDIR = objs +OBJS = $(SRCS:.c=.o) +OBJP = $(addprefix $(OBJDIR)/, $(SRCS:.c=.o)) INCLS = -I. .PHONY = all clean fclean re all: $(NAME) -$(NAME): $(OBJS) - ar rcs $(NAME) $(OBJS) +$(NAME): $(OBJP) + ar rcs $(NAME) $(OBJP) -%.o: %.c libft.h +$(OBJDIR): + mkdir $@ + +$(OBJDIR)/%.o: %.c $(OBJDIR) libft.h $(CC) $(CCFLAGS) $(CCSTD) $(INCLS) -c $< -o $@ clean: diff --git a/ft_atois.c b/ft_atois.c index c10071a..95f198c 100644 --- a/ft_atois.c +++ b/ft_atois.c @@ -6,7 +6,7 @@ /* By: tmaze +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2019/02/27 11:58:44 by tmaze #+# #+# */ -/* Updated: 2019/02/27 17:15:04 by tmaze ### ########.fr */ +/* Updated: 2019/02/28 16:12:07 by tmaze ### ########.fr */ /* */ /* ************************************************************************** */ @@ -30,7 +30,7 @@ int ft_atois(const char *str, int *nb) *nb = 0; mult = 1; while (num >= 0 && ft_isdigit(str[num]) && - (ft_abs(max - *nb) >= 2000000000)) + (ft_abs(max - *nb) >= 2000000000)) { *nb += (str[num--] - '0') * mult; mult *= 10; diff --git a/ft_hasdigit.c b/ft_hasdigit.c index cd12ca0..9c57d0d 100644 --- a/ft_hasdigit.c +++ b/ft_hasdigit.c @@ -6,13 +6,13 @@ /* By: tmaze +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2019/02/25 16:16:40 by tmaze #+# #+# */ -/* Updated: 2019/02/25 16:17:31 by tmaze ### ########.fr */ +/* Updated: 2019/02/28 16:18:26 by tmaze ### ########.fr */ /* */ /* ************************************************************************** */ #include "libft.h" -int ft_hasdigit(char *s) +int ft_hasdigit(char *s) { int i; diff --git a/ft_strsplitwhitespace.c b/ft_strsplitwhitespace.c index f96371c..4b63b77 100644 --- a/ft_strsplitwhitespace.c +++ b/ft_strsplitwhitespace.c @@ -6,7 +6,7 @@ /* By: tmaze +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2019/02/25 16:25:18 by tmaze #+# #+# */ -/* Updated: 2019/02/25 16:26:00 by tmaze ### ########.fr */ +/* Updated: 2019/02/28 16:22:02 by tmaze ### ########.fr */ /* */ /* ************************************************************************** */ @@ -60,7 +60,7 @@ static char **get_table_ws(char const *s, char **tab) return (tab); } -char **ft_strsplitwhitespace(char *s) +char **ft_strsplitwhitespace(char *s) { int nb_words; char **tab;