From: Lukas Jiriste Date: Tue, 3 Oct 2023 15:02:14 +0000 (+0200) Subject: This commit implements the Makefile changes discussed in previous commit. X-Git-Url: https://git.ljiriste.work/?a=commitdiff_plain;h=7f5ddfc2e05cf67a9aa52e77fb6fab96439b0d65;p=42%2Fft_printf.git This commit implements the Makefile changes discussed in previous commit. (As it was not git added) --- diff --git a/Makefile b/Makefile index f2a4059..dcc5668 100644 --- 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