From: Lukas Jiriste Date: Sat, 31 Aug 2024 09:06:49 +0000 (+0200) Subject: Improve Makefile X-Git-Url: https://git.ljiriste.work/?a=commitdiff_plain;h=1151dec13293e897cc27d022f549822db510b1a5;p=42%2Fminishell.git 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. --- 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