generated from NaBuchholz/ft_template_repo
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add inicitialization of submodules
- Loading branch information
Nathalia Vitoria Buchholz
committed
Jan 20, 2025
1 parent
3fc874b
commit 2870263
Showing
1 changed file
with
18 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,7 +6,7 @@ | |
# By: nbuchhol <[email protected]> +#+ +:+ +#+ # | ||
# +#+#+#+#+#+ +#+ # | ||
# Created: 2025/01/03 12:09:52 by nbuchhol #+# #+# # | ||
# Updated: 2025/01/20 16:57:11 by nbuchhol ### ########.fr # | ||
# Updated: 2025/01/20 17:33:23 by nbuchhol ### ########.fr # | ||
# # | ||
# **************************************************************************** # | ||
|
||
|
@@ -23,21 +23,35 @@ OBJ = ${SRC:.c=.o} | |
SUB_DIRS = libft minilibx | ||
RM = rm -f | ||
|
||
all: ${NAME} | ||
all: init-submodules ${NAME} | ||
|
||
${NAME}: ${OBJ} | ||
@${CC} ${OBJ} -o ${NAME} | ||
|
||
%.o: %.c | ||
@${CC} ${CFLAGS} -c $^ -o $@ | ||
|
||
init-submodules: | ||
@if [ ! -d "libft" ] || [ ! -f "libft/.git" ]; then \ | ||
echo "Inicializando submódulo libft..."; \ | ||
git submodule update --init --recursive libft; \ | ||
else \ | ||
echo "Submódulo libft já está inicializado."; \ | ||
fi | ||
@if [ ! -d "minilibx" ] || [ ! -f "minilibx/.git" ]; then \ | ||
echo "Inicializando submódulo minilibx..."; \ | ||
git submodule update --init --recursive minilibx; \ | ||
else \ | ||
echo "Submódulo minilibx já está inicializado."; \ | ||
fi | ||
|
||
clean: | ||
${RM} ${OBJ} | ||
for dir in $(SUBDIRS); do $(MAKE) -C $$dir clean; done | ||
@for dir in $(SUBDIRS); do $(MAKE) -C $$dir clean; done | ||
|
||
fclean: clean | ||
${RM} ${NAME} | ||
|
||
re: fclean all | ||
|
||
.PHONY = all clean fclean re | ||
.PHONY = all clean fclean re init-submodules |