makefile a la norme

This commit is contained in:
Hugo LAMY
2019-12-03 17:47:29 +01:00
parent 90106ef3ae
commit 41e56fce3b
75 changed files with 42 additions and 51 deletions

View File

@@ -52,11 +52,8 @@ SRCS = ft_memset.c \
ft_putstr_fd.c \
ft_putendl_fd.c \
ft_putnbr_fd.c \
ODIR = ./builds
OBJS = $(SRCS:%.c=$(ODIR)/%.o)
SRCB = ft_lstnew.c \
\
ft_lstnew.c \
ft_lstadd_front.c \
ft_lstsize.c \
ft_lstlast.c \
@@ -64,43 +61,43 @@ SRCB = ft_lstnew.c \
ft_lstdelone.c \
ft_lstclear.c \
ft_lstiter.c \
ft_lstmap.c
# \
# ft_strcat.c \
# ft_strcmp.c \
# ft_strcpy.c \
# ft_strncat.c \
# ft_strncpy.c \
# ft_strstr.c \
# ft_strjoinfree.c \
# ft_strclr.c \
# ft_strdel.c \
# ft_strequ.c \
# ft_striter.c \
# ft_striteri.c \
# ft_strmap.c \
# ft_strnequ.c \
# ft_strnew.c \
# ft_memalloc.c \
# ft_memdel.c \
# ft_putchar.c \
# ft_putendl.c \
# ft_putnbr.c \
# ft_putnbrendl.c \
# ft_putnbrendl_fd.c \
# ft_putnbrbase.c \
# ft_putstr.c \
# ft_any.c \
# ft_atoibase.c \
# ft_convertbase.c \
# ft_foreach.c \
# ft_issort.c \
# ft_arraymap.c \
# ft_strmultisplit.c
ft_lstmap.c \
\
ft_strcat.c \
ft_strcmp.c \
ft_strcpy.c \
ft_strncat.c \
ft_strncpy.c \
ft_strstr.c \
ft_strjoinfree.c \
ft_strclr.c \
ft_strdel.c \
ft_strequ.c \
ft_striter.c \
ft_striteri.c \
ft_strmap.c \
ft_strnequ.c \
ft_strnew.c \
ft_memalloc.c \
ft_memdel.c \
ft_putchar.c \
ft_putendl.c \
ft_putnbr.c \
ft_putnbrendl.c \
ft_putnbrendl_fd.c \
ft_putnbrbase.c \
ft_putstr.c \
ft_any.c \
ft_atoibase.c \
ft_convertbase.c \
ft_foreach.c \
ft_issort.c \
ft_arraymap.c \
ft_strmultisplit.c
OBJB = $(SRCB:%.c=$(ODIR)/%.o)
ODIR = ./builds
OBJS = $(SRCS:%.c=$(ODIR)/%.o)
ECHO = "\033[33mcompiling objetcs\033[0m"
# - - - - - - - - - - - #
# rules to execute #
@@ -110,20 +107,14 @@ ECHO = "\033[33mcompiling objetcs\033[0m"
all: $(NAME)
$(ODIR):
@printf "\033[35m\n"
@printf "\033[35m"
mkdir -p $(ODIR)
@printf "\033[0m\n"
$(NAME): $(ODIR) $(OBJS) $(DEPS)
@printf "\033[33m\n"
ar -rc $@ $(OBJS)
ranlib $@
@printf "\033[0m"
bonus: $(ODIR) $(OBJB)
@printf "\033[33m\n"
ar -rc $(NAME) $(OBJB)
ranlib $(NAME)
$(NAME): $(ODIR) $(OBJS) $(DEPS)
@printf "\033[33m"
ar -rc $@ $(OBJS)
ranlib $@
@printf "\033[0m"
$(ODIR)/%.o: %.c