-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
64 lines (45 loc) · 1.91 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
# **************************************************************************** #
# #
# ::: :::::::: #
# Makefile :+: :+: :+: #
# +:+ +:+ +:+ #
# By: jkassand <[email protected]> +#+ +:+ +#+ #
# +#+#+#+#+#+ +#+ #
# Created: 2021/11/15 18:12:03 by jkassand #+# #+# #
# Updated: 2022/05/28 13:15:02 by jkassand ### ########.fr #
# #
# **************************************************************************** #
SRCS = minishell.c heredoc.c pre_open.c cmd_utils.c pipe_utils.c \
free_arg.c pipex.c child.c \
v_empty.c v_free_cmd_red_env.c v_built_utils.c \
args_size.c cmd_add.c cmd_clean.c dollar.c env_funcs.c \
env_to_array.c \
funcs.c lib_funcs.c parser.c pre_parser.c red_funcs.c \
s_signals.c \
s_builtins.c s_builtins2.c s_builtins3.c s_shlvl.c
OBJS = $(SRCS:.c=.o)
LIBDIR = libft
LIBFT_LIB = $(LIBDIR)/libft.a
LIB = -L$(LIBDIR) -lft
NAME = minishell
CC = gcc
CFLAGS = -Wall -Werror -Wextra -I
RDLN = -lreadline -L ~/.brew/Cellar/readline/8.1.1/lib \
-I~/.brew/Cellar/readline/8.1.1/include
RM = rm -f
%.o: %.c Makefile minishell.h
$(CC) $(CFLAGS)$(LIBDIR) -c $< -o $@
$(NAME): $(LIBFT_LIB) $(OBJS)
$(CC) $(CFLAGS)$(LIBDIR) $(OBJS) -o $(NAME) $(LIB) $(RDLN)
all: $(NAME)
$(LIBFT_LIB): tools ;
tools:
make -C $(LIBDIR)
clean:
make clean -C $(LIBDIR)
$(RM) $(OBJS) $(BOBJS)
fclean: clean
make fclean -C $(LIBDIR)
$(RM) $(NAME)
re: fclean all
.PHONY: all clean fclean re tools