-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
66 lines (57 loc) · 1.58 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
NAME = minishell
CFLAGS = -Wall -Wextra -g -Werror
LIBFT = libft
RL_LIB = -I /Users/$(USER)/.brew/opt/readline/include
RL_LINK = -L /Users/$(USER)/.brew/opt/readline/lib
HEADERS = -I $(LIBFT) -I ./includes $(RL_LIB)
LIBS = $(LIBFT)/libft.a
CC = gcc
SRCS = src/loop_shell.c \
src/minishell.c \
src/env/get_env_value.c \
src/env/remove_env_var.c \
src/env/split_env.c \
src/env/remove_exportenv_var.c \
src/env/set_export_env_var.c \
src/utils/init_data.c \
src/utils/free.c \
src/utils/signals.c \
src/utils/pipes.c \
src/utils/expand_variables.c \
src/utils/errors.c \
src/executer/exec_unset.c \
src/executer/execute.c \
src/executer/execute_utils.c \
src/executer/parse_env.c \
src/executer/exec_cd.c \
src/executer/exec_pwd.c \
src/executer/exec_env.c \
src/executer/exec_echo.c \
src/executer/exec_export.c \
src/executer/exec_exit.c \
src/parser/lexer/lexer.c \
src/parser/lexer/utils.c \
src/parser/lexer/actions.c \
src/parser/lexer/states.c \
src/parser/parser/parser.c \
src/parser/parser/states.c \
src/parser/parser/states2.c \
src/parser/parser/actions.c \
src/parser/parser/actions_heredoc.c \
src/parser/parser/utils.c \
OBJS = $(SRCS:.c=.o)
all: libft $(NAME)
libft:
make -C $(LIBFT)
%.o: %.c
$(CC) $(CFLAGS) $(HEADERS) -c $< -o $@
$(NAME): $(OBJS)
$(CC) $(CFLAGS) $(SRCS) $(LIBFT)/libft.a -lreadline $(RL_LINK) $(HEADERS) -o $(NAME)
clean:
rm -rf $(OBJS)
make clean -C $(LIBFT)
fclean: clean
rm -rf $(NAME)
rm -rf $(LIBFT)/libft.a
re: fclean all
.PHONY: all clean fclean re libmlx libft