makefile avec couleurs
This commit is contained in:
@@ -9,9 +9,8 @@ VPATH = srcs/part1/ \
|
|||||||
srcs/bonus/ \
|
srcs/bonus/ \
|
||||||
srcs/add/
|
srcs/add/
|
||||||
|
|
||||||
IDIR = includes
|
IDIR = .
|
||||||
_DEP = libft.h \
|
_DEP = libft.h \
|
||||||
libonus.h
|
|
||||||
DEPS = $(_DEP:%.h=$(IDIR)/%.h)
|
DEPS = $(_DEP:%.h=$(IDIR)/%.h)
|
||||||
|
|
||||||
CFLAGS = -I$(IDIR)
|
CFLAGS = -I$(IDIR)
|
||||||
@@ -58,9 +57,9 @@ OBJS = $(SRCS:%.c=$(ODIR)/%.o)
|
|||||||
|
|
||||||
SRCB = ft_lstnew.c \
|
SRCB = ft_lstnew.c \
|
||||||
ft_lstadd_front.c \
|
ft_lstadd_front.c \
|
||||||
ft_lstsize \
|
ft_lstsize.c \
|
||||||
ft_lstlast \
|
ft_lstlast.c \
|
||||||
ft_lstadd_back \
|
ft_lstadd_back.c \
|
||||||
ft_lstdelone.c \
|
ft_lstdelone.c \
|
||||||
ft_lstclear.c \
|
ft_lstclear.c \
|
||||||
ft_lstiter.c \
|
ft_lstiter.c \
|
||||||
@@ -108,15 +107,24 @@ OBJB = $(SRCB:%.c=$(ODIR)/%.o)
|
|||||||
|
|
||||||
all: $(ODIR) $(NAME)
|
all: $(ODIR) $(NAME)
|
||||||
|
|
||||||
|
echo:
|
||||||
|
@echo "\033[33mcompiling objetcs\033[0m"
|
||||||
|
|
||||||
|
echob:
|
||||||
|
@echo "\033[33mcompiling objetcs for bonus\033[0m"
|
||||||
|
|
||||||
$(ODIR):
|
$(ODIR):
|
||||||
|
@echo "\033[33mcreate $(ODIR)\033[0m"
|
||||||
mkdir -p $(ODIR)
|
mkdir -p $(ODIR)
|
||||||
|
|
||||||
$(NAME): $(OBJS) $(DEPS)
|
$(NAME): echo $(OBJS) $(DEPS)
|
||||||
|
@echo "\033[33mbuilding $(NAME)\033[0m"
|
||||||
ar -rc $@ $(OBJS)
|
ar -rc $@ $(OBJS)
|
||||||
@ranlib $@
|
@ranlib $@
|
||||||
|
|
||||||
bonus: $(OBJB)
|
bonus: echob $(OBJB)
|
||||||
ar rc $(NAME) $(OBJB)
|
@echo "\033[33madding the bonus functions to $(NAME)\033[0m"
|
||||||
|
ar -rc $(NAME) $(OBJB)
|
||||||
@ranlib $(NAME)
|
@ranlib $(NAME)
|
||||||
|
|
||||||
$(ODIR)/%.o: %.c
|
$(ODIR)/%.o: %.c
|
||||||
@@ -130,7 +138,7 @@ fclean: clean
|
|||||||
|
|
||||||
re: fclean all
|
re: fclean all
|
||||||
|
|
||||||
.PHONY: bonus clean fclean re all
|
.PHONY: echo echob bonus clean fclean re all
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -6,7 +6,7 @@
|
|||||||
/* By: hulamy <marvin@42.fr> +#+ +:+ +#+ */
|
/* By: hulamy <marvin@42.fr> +#+ +:+ +#+ */
|
||||||
/* +#+#+#+#+#+ +#+ */
|
/* +#+#+#+#+#+ +#+ */
|
||||||
/* Created: 2019/11/25 14:45:53 by hulamy #+# #+# */
|
/* 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_putendl_fd(char *s, int fd);
|
||||||
void ft_putnbr_fd(int n, 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
|
typedef struct s_list
|
||||||
{
|
{
|
||||||
void *content;
|
void *content;
|
||||||
struct s_list *next;
|
struct s_list *next;
|
||||||
} t_list;
|
} 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);
|
char *ft_strcat(char *s1, const char *s2);
|
||||||
int ft_strcmp(const char *s1, const char *s2);
|
int ft_strcmp(const char *s1, const char *s2);
|
||||||
char *ft_strcpy(char *dst, const char *src);
|
char *ft_strcpy(char *dst, const char *src);
|
||||||
|
|||||||
Vendored
BIN
Binary file not shown.
Binary file not shown.
@@ -6,7 +6,7 @@
|
|||||||
/* By: hulamy <marvin@42.fr> +#+ +:+ +#+ */
|
/* By: hulamy <marvin@42.fr> +#+ +:+ +#+ */
|
||||||
/* +#+#+#+#+#+ +#+ */
|
/* +#+#+#+#+#+ +#+ */
|
||||||
/* Created: 2019/11/25 14:31:48 by hulamy #+# #+# */
|
/* 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.
@@ -6,7 +6,7 @@
|
|||||||
/* By: hulamy <marvin@42.fr> +#+ +:+ +#+ */
|
/* By: hulamy <marvin@42.fr> +#+ +:+ +#+ */
|
||||||
/* +#+#+#+#+#+ +#+ */
|
/* +#+#+#+#+#+ +#+ */
|
||||||
/* Created: 2019/11/25 13:57:19 by hulamy #+# #+# */
|
/* 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 ft_strlcpy(char *dest, const char *src, size_t size)
|
||||||
{
|
{
|
||||||
size_t i;
|
size_t i;
|
||||||
|
|||||||
@@ -6,7 +6,7 @@
|
|||||||
/* By: hulamy <marvin@42.fr> +#+ +:+ +#+ */
|
/* By: hulamy <marvin@42.fr> +#+ +:+ +#+ */
|
||||||
/* +#+#+#+#+#+ +#+ */
|
/* +#+#+#+#+#+ +#+ */
|
||||||
/* Created: 2019/11/25 14:00:13 by hulamy #+# #+# */
|
/* 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;
|
len = 0;
|
||||||
while (s[i + len] && s[i + len] != c)
|
while (s[i + len] && s[i + len] != c)
|
||||||
len++;
|
len++;
|
||||||
array[j++] = ft_strsub(s, i, len);
|
array[j++] = ft_substr(s, i, len);
|
||||||
i = i + len - 1;
|
i = i + len - 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user