forked from ZomDev3343/42-cursus-minishell
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
75 lines (57 loc) · 2.31 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
# **************************************************************************** #
# #
# ::: :::::::: #
# Makefile :+: :+: :+: #
# +:+ +:+ +:+ #
# By: fbelotti <[email protected]> +#+ +:+ +#+ #
# +#+#+#+#+#+ +#+ #
# Created: 2024/06/20 11:47:53 by fbelotti #+# #+# #
# Updated: 2024/06/20 11:52:03 by fbelotti ### ########.fr #
# #
# **************************************************************************** #
NAME = minishell
AUTHOR1 = ZomDev3343
AUTHOR2 = Florent Belotti
CC = gcc
RM = rm -f
CFLAGS = -Wall -Wextra -Werror -g
INCLUDES = -I./Includes -I./Includes/zom_libft -I/opt/homebrew/Cellar/readline/8.2.10/include
LIBS = ./Includes/zom_libft/libft.a -L/opt/homebrew/Cellar/readline/8.2.10/lib -lreadline -lhistory
SRCDIR = Src
OBJDIR = obj
SRC = $(shell find $(SRCDIR) -name \*.c -type f -print)
OBJ = $(patsubst $(SRCDIR)/%.c,$(OBJDIR)/%.o,$(SRC))
DEPS = $(OBJ:.o=.d)
all: announce intro libft $(NAME)
announce:
@echo "\n==================================="
@echo "Project: $(NAME)\n"
@echo "Parsing: $(AUTHOR1)"
@echo "Execution: $(AUTHOR2)"
@echo "===================================\n"
intro:
@echo "Starting the build process...\n"
$(NAME): $(OBJ)
@echo "\nminishell: Creating library..."
@$(MAKE) -C ./Includes/zom_libft > /dev/null
@$(CC) $(CFLAGS) $(OBJ) $(LIBS) $(INCLUDES) -o $@
@echo "minishell: Executable $@ created."
$(OBJDIR)/%.o: $(SRCDIR)/%.c
@mkdir -p $(dir $@)
@echo "minishell: Src: compiling file $@"
@$(CC) $(CFLAGS) $(INCLUDES) -MMD -c $< -o $@
libft:
@$(MAKE) -C ./Includes/zom_libft > /dev/null
-include $(DEPS)
clean:
@$(RM) $(OBJ)
@$(MAKE) -C ./Includes/zom_libft clean > /dev/null
@echo "Cleaned."
fclean: clean
@$(RM) $(NAME)
@$(MAKE) -C ./Includes/zom_libft fclean > /dev/null
@echo "Fully cleaned."
re: fclean all
debug: CFLAGS += $(DEBUG_FLAGS)
debug: re
.PHONY: all clean fclean re libft announce intro