Skip to content

Commit 5502809

Browse files
committed
Makefile fix: calling 're_bonus'/ 're_all_bonus' called make twice
1 parent b8a70f3 commit 5502809

File tree

2 files changed

+10
-14
lines changed

2 files changed

+10
-14
lines changed

Makefile

+8-12
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
# By: aschenk <[email protected]> +#+ +:+ +#+ #
77
# +#+#+#+#+#+ +#+ #
88
# Created: 2024/11/07 16:20:40 by aschenk #+# #+# #
9-
# Updated: 2025/02/25 20:45:40 by aschenk ### ########.fr #
9+
# Updated: 2025/02/25 21:18:27 by aschenk ### ########.fr #
1010
# #
1111
# **************************************************************************** #
1212

@@ -189,7 +189,7 @@ $(LIBMLX):
189189
git clone https://github.com/42Paris/minilibx-linux.git $(MLX_DIR) >/dev/null 2>&1; \
190190
fi
191191
@echo "Compiling MiniLibX..."
192-
@make -s -C $(MLX_DIR) >/dev/null 2>&1;
192+
@$(MAKE) -s -C $(MLX_DIR) >/dev/null 2>&1;
193193
@echo "$(BOLD)MiniLibX compiled.$(RESET)"
194194

195195
# Build libft library by calling 'make' in LIBFT_DIR.
@@ -246,7 +246,7 @@ $(LIBFT): $(LIBFT_DIR)/libft.h \
246246
$(LIBFT_DIR)/ft_printf_utils.c \
247247
$(LIBFT_DIR)/ft_printf.c \
248248
$(LIBFT_DIR)/ft_atoi_base.c
249-
@make -s -C $(LIBFT_DIR)
249+
@$(MAKE) -s -C $(LIBFT_DIR)
250250
@echo ""
251251

252252
# Compilation of program; depends on $(OBJS) and library files
@@ -274,7 +274,7 @@ $(NAME): $(OBJS) $(LIBFT) $(LIBMLX)
274274
# Target to remove all generated files BUT the program executable and compiled libraries.
275275
clean:
276276
@rm -rf $(OBJS_DIR)
277-
@make -s -C $(LIBFT_DIR) clean >/dev/null 2>&1
277+
@$(MAKE) -s -C $(LIBFT_DIR) clean >/dev/null 2>&1
278278
@rm -rf $(MLX_DIR)/obj
279279
@echo "$(BOLD)$(RED)Object files removed.$(RESET)"
280280

@@ -285,7 +285,7 @@ fclean: clean
285285

286286
# Target to remove all generated files and the program executable (NOT the compiled libraries).
287287
fclean_all: fclean
288-
@make -s -C $(LIBFT_DIR) fclean >/dev/null 2>&1
288+
@$(MAKE) -s -C $(LIBFT_DIR) fclean >/dev/null 2>&1
289289
@rm -rf $(MLX_DIR)
290290
@echo "$(BOLD)$(RED)Library files removed.$(RESET)"
291291

@@ -303,14 +303,10 @@ re_all: fclean_all
303303

304304
# Bonus rules
305305
bonus:
306-
@$(MAKE) BONUS=1 all
306+
@$(MAKE) BONUS=1
307307

308-
re_bonus: fclean
309-
@echo ""
310-
@$(MAKE) -s bonus
308+
re_bonus: fclean bonus
311309

312-
re_all_bonus: fclean_all
313-
@echo ""
314-
@$(MAKE) -s bonus
310+
re_all_bonus: fclean_all bonus
315311

316312
.PHONY: all clean fclean fclean_all re re_all bonus re_bonus re_all_bonus

lib/libft/Makefile

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
# By: aschenk <[email protected]> +#+ +:+ +#+ #
77
# +#+#+#+#+#+ +#+ #
88
# Created: 2023/11/13 11:41:06 by aschenk #+# #+# #
9-
# Updated: 2025/02/25 20:48:06 by aschenk ### ########.fr #
9+
# Updated: 2025/02/25 21:08:16 by aschenk ### ########.fr #
1010
# #
1111
# **************************************************************************** #
1212

@@ -113,7 +113,7 @@ clean:
113113

114114
# Target 'fclean' depends on 'clean' and removes the library as well.
115115
fclean: clean
116-
@rm -f $(NAME)*
116+
@rm -f $(NAME)
117117
@echo "$(BOLD)$(RED)$(NAME) removed.$(RESET)"
118118

119119
# Target 're' depends on 'fclean' and 'all', rebuilding the project from scratch.

0 commit comments

Comments
 (0)