From 1151dec13293e897cc27d022f549822db510b1a5 Mon Sep 17 00:00:00 2001 From: Lukas Jiriste Date: Sat, 31 Aug 2024 11:06:49 +0200 Subject: [PATCH] Improve Makefile Make now tries to build Libft everytime but when libft.a stays the same (no change made in Libft) the libft.a is considered not changed. Before the libft.a was assumed to never be up to date (PHONY) hence the minishell was always rebuilt. Before that even the changes in Libft didn't trigger building of libft.a when minishell make was run. --- Makefile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index fe257ef..92ccf33 100644 --- a/Makefile +++ b/Makefile @@ -76,12 +76,12 @@ readline : $(MAKE) shallow_fclean touch $@ -.PHONY : Libft/libft.a - $(NAME) : $(OBJECTS) Libft/libft.a $(CC) $(CFLAGS) -o $@ $^ $(LINKS) -Libft/libft.a : | Libft/Makefile +FORCE: ; + +Libft/libft.a : FORCE | Libft/Makefile $(MAKE) -C Libft %.o : %.c | Libft/Makefile -- 2.30.2