makefile avec couleurs

This commit is contained in:
Hugo LAMY
2019-11-25 17:13:04 +01:00
parent 96c7ce814e
commit 09087b01a7
83 changed files with 34 additions and 24 deletions

View File

@@ -9,9 +9,8 @@ VPATH = srcs/part1/ \
srcs/bonus/ \
srcs/add/
IDIR = includes
IDIR = .
_DEP = libft.h \
libonus.h
DEPS = $(_DEP:%.h=$(IDIR)/%.h)
CFLAGS = -I$(IDIR)
@@ -58,9 +57,9 @@ OBJS = $(SRCS:%.c=$(ODIR)/%.o)
SRCB = ft_lstnew.c \
ft_lstadd_front.c \
ft_lstsize \
ft_lstlast \
ft_lstadd_back \
ft_lstsize.c \
ft_lstlast.c \
ft_lstadd_back.c \
ft_lstdelone.c \
ft_lstclear.c \
ft_lstiter.c \
@@ -108,15 +107,24 @@ OBJB = $(SRCB:%.c=$(ODIR)/%.o)
all: $(ODIR) $(NAME)
echo:
@echo "\033[33mcompiling objetcs\033[0m"
echob:
@echo "\033[33mcompiling objetcs for bonus\033[0m"
$(ODIR):
@echo "\033[33mcreate $(ODIR)\033[0m"
mkdir -p $(ODIR)
$(NAME): $(OBJS) $(DEPS)
$(NAME): echo $(OBJS) $(DEPS)
@echo "\033[33mbuilding $(NAME)\033[0m"
ar -rc $@ $(OBJS)
@ranlib $@
bonus: $(OBJB)
ar rc $(NAME) $(OBJB)
bonus: echob $(OBJB)
@echo "\033[33madding the bonus functions to $(NAME)\033[0m"
ar -rc $(NAME) $(OBJB)
@ranlib $(NAME)
$(ODIR)/%.o: %.c
@@ -130,7 +138,7 @@ fclean: clean
re: fclean all
.PHONY: bonus clean fclean re all
.PHONY: echo echob bonus clean fclean re all

BIN
builds/ft_any.o Normal file

Binary file not shown.

BIN
builds/ft_arraymap.o Normal file

Binary file not shown.

BIN
builds/ft_atoi.o Normal file

Binary file not shown.

BIN
builds/ft_atoibase.o Normal file

Binary file not shown.

BIN
builds/ft_bzero.o Normal file

Binary file not shown.

BIN
builds/ft_calloc.o Normal file

Binary file not shown.

BIN
builds/ft_convertbase.o Normal file

Binary file not shown.

BIN
builds/ft_foreach.o Normal file

Binary file not shown.

BIN
builds/ft_isalnum.o Normal file

Binary file not shown.

BIN
builds/ft_isalpha.o Normal file

Binary file not shown.

BIN
builds/ft_isascii.o Normal file

Binary file not shown.

BIN
builds/ft_isdigit.o Normal file

Binary file not shown.

BIN
builds/ft_isprint.o Normal file

Binary file not shown.

BIN
builds/ft_issort.o Normal file

Binary file not shown.

BIN
builds/ft_itoa.o Normal file

Binary file not shown.

BIN
builds/ft_lstadd_back.o Normal file

Binary file not shown.

BIN
builds/ft_lstadd_front.o Normal file

Binary file not shown.

BIN
builds/ft_lstclear.o Normal file

Binary file not shown.

BIN
builds/ft_lstdelone.o Normal file

Binary file not shown.

BIN
builds/ft_lstiter.o Normal file

Binary file not shown.

BIN
builds/ft_lstlast.o Normal file

Binary file not shown.

BIN
builds/ft_lstmap.o Normal file

Binary file not shown.

BIN
builds/ft_lstnew.o Normal file

Binary file not shown.

BIN
builds/ft_lstsize.o Normal file

Binary file not shown.

BIN
builds/ft_memalloc.o Normal file

Binary file not shown.

BIN
builds/ft_memccpy.o Normal file

Binary file not shown.

BIN
builds/ft_memchr.o Normal file

Binary file not shown.

BIN
builds/ft_memcmp.o Normal file

Binary file not shown.

BIN
builds/ft_memcpy.o Normal file

Binary file not shown.

BIN
builds/ft_memdel.o Normal file

Binary file not shown.

BIN
builds/ft_memmove.o Normal file

Binary file not shown.

BIN
builds/ft_memset.o Normal file

Binary file not shown.

BIN
builds/ft_putchar.o Normal file

Binary file not shown.

BIN
builds/ft_putchar_fd.o Normal file

Binary file not shown.

BIN
builds/ft_putendl.o Normal file

Binary file not shown.

BIN
builds/ft_putendl_fd.o Normal file

Binary file not shown.

BIN
builds/ft_putnbr.o Normal file

Binary file not shown.

BIN
builds/ft_putnbr_fd.o Normal file

Binary file not shown.

BIN
builds/ft_putnbrbase.o Normal file

Binary file not shown.

BIN
builds/ft_putnbrendl.o Normal file

Binary file not shown.

BIN
builds/ft_putnbrendl_fd.o Normal file

Binary file not shown.

BIN
builds/ft_putstr.o Normal file

Binary file not shown.

BIN
builds/ft_putstr_fd.o Normal file

Binary file not shown.

BIN
builds/ft_split.o Normal file

Binary file not shown.

BIN
builds/ft_strcat.o Normal file

Binary file not shown.

BIN
builds/ft_strchr.o Normal file

Binary file not shown.

BIN
builds/ft_strclr.o Normal file

Binary file not shown.

BIN
builds/ft_strcmp.o Normal file

Binary file not shown.

BIN
builds/ft_strcpy.o Normal file

Binary file not shown.

BIN
builds/ft_strdel.o Normal file

Binary file not shown.

BIN
builds/ft_strdup.o Normal file

Binary file not shown.

BIN
builds/ft_strequ.o Normal file

Binary file not shown.

BIN
builds/ft_striter.o Normal file

Binary file not shown.

BIN
builds/ft_striteri.o Normal file

Binary file not shown.

BIN
builds/ft_strjoin.o Normal file

Binary file not shown.

BIN
builds/ft_strjoinfree.o Normal file

Binary file not shown.

BIN
builds/ft_strlcat.o Normal file

Binary file not shown.

BIN
builds/ft_strlcpy.o Normal file

Binary file not shown.

BIN
builds/ft_strlen.o Normal file

Binary file not shown.

BIN
builds/ft_strmap.o Normal file

Binary file not shown.

BIN
builds/ft_strmapi.o Normal file

Binary file not shown.

BIN
builds/ft_strmultisplit.o Normal file

Binary file not shown.

BIN
builds/ft_strncat.o Normal file

Binary file not shown.

BIN
builds/ft_strncmp.o Normal file

Binary file not shown.

BIN
builds/ft_strncpy.o Normal file

Binary file not shown.

BIN
builds/ft_strnequ.o Normal file

Binary file not shown.

BIN
builds/ft_strnew.o Normal file

Binary file not shown.

BIN
builds/ft_strnstr.o Normal file

Binary file not shown.

BIN
builds/ft_strrchr.o Normal file

Binary file not shown.

BIN
builds/ft_strstr.o Normal file

Binary file not shown.

BIN
builds/ft_strtrim.o Normal file

Binary file not shown.

BIN
builds/ft_substr.o Normal file

Binary file not shown.

BIN
builds/ft_tolower.o Normal file

Binary file not shown.

BIN
builds/ft_toupper.o Normal file

Binary file not shown.

BIN
libft.a Normal file

Binary file not shown.

22
libft.h
View File

@@ -6,7 +6,7 @@
/* By: hulamy <marvin@42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2019/11/25 14:45:53 by hulamy #+# #+# */
/* Updated: 2019/11/25 15:45:05 by hulamy ### ########.fr */
/* Updated: 2019/11/25 17:11:09 by hulamy ### ########.fr */
/* */
/* ************************************************************************** */
@@ -52,22 +52,22 @@ void ft_putstr_fd(char *s, int fd);
void ft_putendl_fd(char *s, int fd);
void ft_putnbr_fd(int n, int fd);
t_list *ft_lstnew(void *content);
void ft_lstadd_front(t_list **alst, t_list *n);
int ft_lstsize(t_list *lst);
t_list *ft_lstlast(t_list *lst);
void ft_lstadd_back(t_list **alst, t_list *n);
void ft_lstdelone(t_list **lst, void (*del)(void *));
void ft_lstclear(t_list **lst, void (*del)(void *));
void ft_lstiter(t_list *lst, void (*f)(void *));
t_list *ft_lstmap(t_list *l, void *(*f)(void*), void (*d)(void*));
typedef struct s_list
{
void *content;
struct s_list *next;
} t_list;
t_list *ft_lstnew(void *content);
void ft_lstadd_front(t_list **alst, t_list *n);
int ft_lstsize(t_list *lst);
t_list *ft_lstlast(t_list *lst);
void ft_lstadd_back(t_list **alst, t_list *n);
void ft_lstdelone(t_list *lst, void (*del)(void *));
void ft_lstclear(t_list **lst, void (*del)(void *));
void ft_lstiter(t_list *lst, void (*f)(void *));
t_list *ft_lstmap(t_list *l, void *(*f)(void*), void (*d)(void*));
char *ft_strcat(char *s1, const char *s2);
int ft_strcmp(const char *s1, const char *s2);
char *ft_strcpy(char *dst, const char *src);

BIN
srcs/bonus/.DS_Store vendored

Binary file not shown.

Binary file not shown.

View File

@@ -6,7 +6,7 @@
/* By: hulamy <marvin@42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2019/11/25 14:31:48 by hulamy #+# #+# */
/* Updated: 2019/11/25 14:32:30 by hulamy ### ########.fr */
/* Updated: 2019/11/25 16:06:41 by hulamy ### ########.fr */
/* */
/* ************************************************************************** */

Binary file not shown.

View File

@@ -6,7 +6,7 @@
/* By: hulamy <marvin@42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2019/11/25 13:57:19 by hulamy #+# #+# */
/* Updated: 2019/11/25 14:28:12 by hulamy ### ########.fr */
/* Updated: 2019/11/25 15:53:19 by hulamy ### ########.fr */
/* */
/* ************************************************************************** */
@@ -45,6 +45,8 @@
** }
*/
#include "libft.h"
size_t ft_strlcpy(char *dest, const char *src, size_t size)
{
size_t i;

View File

@@ -6,7 +6,7 @@
/* By: hulamy <marvin@42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2019/11/25 14:00:13 by hulamy #+# #+# */
/* Updated: 2019/11/25 14:01:09 by hulamy ### ########.fr */
/* Updated: 2019/11/25 15:54:07 by hulamy ### ########.fr */
/* */
/* ************************************************************************** */
@@ -53,7 +53,7 @@ char **ft_split(char const *s, char c)
len = 0;
while (s[i + len] && s[i + len] != c)
len++;
array[j++] = ft_strsub(s, i, len);
array[j++] = ft_substr(s, i, len);
i = i + len - 1;
}
}