-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
60 lines (44 loc) · 961 Bytes
/
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
NAME = minishell
CC = cc
SRC = execution.c \
parser.c \
lexer_mid_fts.c \
expand.c \
lexer_edge_fts.c \
process_tokens.c \
generate_structs.c \
get_heredoc.c \
get_hd_input.c \
clean_exit.c \
check_command.c \
main.c \
redirect.c \
inits.c \
iterate_shlvl.c \
builtins/builtins.c \
builtins/ft_export.c \
builtins/ft_export_utils.c \
builtins/ft_exit.c \
builtins/ft_cd.c \
builtins/ft_echo.c
OBJS = $(SRC:.c=.o)
CFLAGS = -Wall -Wextra -Werror -g
INCL = -Ilibft/ -I/usr/include
LIBFT_PATH = libft/
LIBFT_NAME = libft.a
LIBFT = $(LIBFT_PATH)$(LIBFT_NAME)
.PHONY: all clean fclean re
all: $(LIBFT) $(NAME)
$(NAME): $(OBJS) minishell.h
$(CC) $(CFLAGS) $(OBJS) -o $(NAME) $(LIBFT) $(INCL) -lreadline
$(LIBFT):
@make -sC $(LIBFT_PATH)
%.o: %.c
$(CC) $(CFLAGS) $(INCL) -c $< -o $@
clean:
rm -f $(OBJS)
@make clean -C $(LIBFT_PATH)
fclean: clean
rm -f $(NAME)
@make fclean -C $(LIBFT_PATH)
re: fclean all