-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
71 lines (59 loc) · 1.71 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
NAME = minishell
CC = cc
# CFLAGS = -Wall -Wextra -Werror
# CFLAGS = -Wall -Wextra -Werror -I/Users/$(USER)/.brew/opt/readline/include -g3 #-fsanitize=address
CFLAGS = -Wall -Wextra -Werror -I/opt/homebrew/opt/readline/include -fsanitize=address -g3
# LDFLAGS = -lreadline -L /Users/$(USER)/.brew/opt/readline/lib
LDFLAGS = -lreadline -L /opt/homebrew/opt/readline/lib
#SFLAGS = -g3 -fsanitize=address
FILES = srcs/main \
srcs/free_shell \
srcs/signals \
srcs/parse_input/parser \
srcs/parse_input/build_cmd \
srcs/parse_input/build_pipe \
srcs/parse_input/build_io \
srcs/parse_input/build_variable \
srcs/parse_input/build_variable_utils \
srcs/parse_input/build_split \
srcs/parse_input/build_split_utils \
srcs/parse_input/handle_quotes \
srcs/errors \
srcs/gethings \
srcs/get_things_aux \
srcs/utilslist \
srcs/builtins/cd \
srcs/builtins/echo \
srcs/builtins/export \
srcs/builtins/export_utils \
srcs/builtins/unset \
srcs/builtins/exit \
srcs/builtins/pwd \
srcs/pipes/cmd_handler \
srcs/pipes/manage_files \
srcs/pipes/process_utils \
srcs/pipes/pipes_utils \
srcs/pipes/run_pipes \
srcs/pipes/aux_run_pipes
CFILES = $(addsuffix .c, $(FILES))
OBJS = $(addsuffix .o, $(FILES))
HEADERS = includes/
LIBFT_DIR = srcs/libft
LEXER_DIR = srcs/lexer
all: $(NAME)
.c.o: $(CFILES)
$(CC) $(CFLAGS) -I $(HEADERS) -c $< -o $@
$(NAME): $(OBJS)
make -C $(LIBFT_DIR)
$(CC) $(CFLAGS) -o $@ $^ -L $(LIBFT_DIR) -lft $(LDFLAGS)
fsanitize:
$(eval CFLAGS +=-fsanitize=address -g3)
sanitize: fsanitize all
clean:
rm -rf $(OBJS)
make clean -C $(LIBFT_DIR)
fclean: clean
rm -rf *.dSYM
rm -rf srcs/libft/libft.a
re: fclean all
.PHONY: all clean fclean re