made Makefile a dependency, and put the flags in the make file aswell

This commit is contained in:
whaffman 2025-03-01 12:18:56 +01:00
parent 888476ea0c
commit 0109620855

View File

@ -6,11 +6,12 @@
# By: qmennen <qmennen@student.codam.nl> +#+ #
# +#+ #
# Created: 2024/10/15 11:48:46 by whaffman #+# #+# #
# Updated: 2025/03/01 11:59:38 by whaffman ######## odam.nl #
# Updated: 2025/03/01 12:18:10 by whaffman ######## odam.nl #
# #
# **************************************************************************** #
NAME = minishell
# FLAGS=-DNOCOLORS -DNOBANNER -DNOPROMPT
SRC_PATH = src
INC_PATH = inc
@ -57,13 +58,13 @@ run_$(1): $(1)
$$(info $$(bold)$$(green)Running $(1)$$(reset))
./$(BUILD_PATH)/$(1)/$(NAME)
$(BUILD_PATH)/$(1)/$(NAME): $(LIBFT) $$($(1)_OBJECTS)
$(BUILD_PATH)/$(1)/$(NAME): $(LIBFT) $$($(1)_OBJECTS) Makefile
$$(info $$(bold)$$(green)Linking $(1) config$$(reset))
$$(CC) $$(CFLAGS) $$($(1)_OBJECTS) $$(LDLIBS) -o $$@
-include $$($(1)_DEPENDS)
$$($(1)_OBJ_PATH)/%.o: %.c $(LIBFT) | $$($(1)_OBJ_PATH)
$$($(1)_OBJ_PATH)/%.o: %.c $(LIBFT) Makefile | $$($(1)_OBJ_PATH)
$$(CC) $$(CFLAGS) $$(INCLUDES) -MMD -MP -c $$< -o $$@
$$($(1)_OBJ_PATH):
@ -157,7 +158,6 @@ help:
@echo " $(green)$(bold)sources.mk $(reset)- Generate sources.mk"
@echo ""
.PHONY: submodules
submodules:
$(info $(bold)$(green)Checking and reinitializing submodules$(reset))