This commit implements the Makefile changes discussed in previous commit.
authorLukas Jiriste <ljiriste@student.42prague.com>
Tue, 3 Oct 2023 15:02:14 +0000 (17:02 +0200)
committerLukas Jiriste <ljiriste@student.42prague.com>
Tue, 3 Oct 2023 15:02:14 +0000 (17:02 +0200)
(As it was not git added)

Makefile

index f2a40598a05a78cdf809a1854ad3dd768e6d2b00..dcc5668329b31d24012dbd78052fa23440012672 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -4,42 +4,26 @@ AR = ar
 
 RM = rm -f
 
-INCLUDE = $(addprefix -I, . ./Libft)
+INCLUDE = $(addprefix -I, . ..)
 SRCDIR = .
-# SOURCES = $(addprefix $(SRCDIR)/, ft_putchar.c ft_putstr.c ft_strcmp.c ft_strlen.c ft_swap.c)
 SOURCES = $(shell find $(SRCDIR) -maxdepth 1 -name "*.c")
 OBJECTS = $(SOURCES:.c=.o)
 
-NAME = libftprintf.a
+NAME = ft_printf.a
 
 all : $(NAME)
 
-$(NAME) : $(OBJECTS) Libft/libft.a
-       cp Libft/libft.a $(NAME)
+$(NAME) : $(OBJECTS)
        $(AR) rcs $(NAME) $(OBJECTS)
 
-Libft/libft.a : Libft/libft.h
-       $(MAKE) -C ./Libft
-
-%.o : %.c Libft/libft.h
+%.o : %.c
        $(CC) $(CFLAGS) -o $@ -c $< $(INCLUDE)
 
 clean :
        $(RM) $(OBJECTS)
-       $(MAKE) -C ./Libft clean
 
-fclean :
-       $(RM) $(OBJECTS)
+fclean : clean
        $(RM) $(NAME)
-       $(MAKE) -C ./Libft fclean
 
 re : fclean
        $(MAKE) all
-
-Libft/libft.h :
-       git submodule update --init Libft
-       git -C ./Libft checkout no_crash
-
-bonus : all
-
-.PHONY : Libft