-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
57 lines (46 loc) · 1.04 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
# Makefile for minishell
# Auother: Bobbie Syvasalmi
# Version 1.0
# Date: 01/28/2024
NAME = minishell
LIB = libft/libft.a
LIBDIR = ./libft
READLINE_LIB = ~/.brew/opt/readline/lib
READLINE_HEADER = ~/.brew/opt/readline/include
SRC = minishell.c \
minishell_prompt.c \
minishell_history.c \
minishell_utils.c \
minishell_builtins.c \
minishell_builtins_exit.c \
pipex.c \
pipex_execute.c \
pipex_redirect.c \
pipex_redirect_utils.c \
pipex_interpret.c \
pipex_env_variables.c \
pipex_path.c \
pipex_path_exit.c \
pipex_builtins.c \
pipex_utils.c \
pipex_command.c \
pipex_free.c \
pipex_exit.c
OBJ = $(SRC:%.c=%.o)
CC = cc
CFLAGS = -Wall -Wextra -Werror
$(NAME): $(OBJ)
$(CC) $(CFLAGS) $(OBJ) -I. -L$(LIBDIR) -lft -L $(READLINE_LIB) -I $(READLINE_HEADER) -lreadline -o $(NAME)
all: $(NAME)
%.o: %.c $(LIB)
$(CC) $(CFLAGS) -I. -I $(READLINE_HEADER) $< -c
$(LIB):
make -C $(LIBDIR)
clean:
rm -rf *.o
make -C $(LIBDIR) clean
fclean: clean
rm -f $(NAME)
rm -f $(LIB)
re: fclean all
.phony: all clean fclean re