-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
74 lines (61 loc) · 2 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
72
73
74
# **************************************************************************** #
# #
# ::: :::::::: #
# Makefile :+: :+: :+: #
# +:+ +:+ +:+ #
# By: rcammaro <[email protected]> +#+ +:+ +#+ #
# +#+#+#+#+#+ +#+ #
# Created: 2021/07/25 19:12:10 by rcammaro #+# #+# #
# Updated: 2021/07/28 15:28:22 by rcammaro ### ########.fr #
# #
# **************************************************************************** #
SRCS = builtin_cd.c \
builtin_exit.c \
builtin_export.c \
builtins_env_echo_pwd_unset.c \
clear_memory.c \
env_setup.c \
env_utils.c \
error.c \
execute_binary.c \
execute_line.c \
expansion_2.c \
expansion.c \
here_doc.c \
here_doc_2.c \
main.c \
parse_redirections_2.c \
parse_redirections.c \
parser_split_by_pipe.c \
pipeline.c \
preprocessor.c \
redirections.c \
resolve_path.c \
run_builtin.c \
set_var.c \
signal_handler.c
SRC = $(addprefix src/,$(SRCS))
OBJ = $(SRC:.c=.o)
LIBFT = libft/libft.a
INCLUDES = -I include -I libft
LIBS = -lft -L libft -lreadline
# for 19's Macs, uncomment lines below:
# INCLUDES += -I /Users/$(USER)/.brew/opt/readline/include
# LIBS += -L /Users/$(USER)/.brew/opt/readline/lib
HEADER = include/header.h
CC = gcc
FLAGS = -Wall -Wextra -Werror
NAME = minishell
all: $(NAME)
$(NAME): $(LIBFT) $(OBJ)
$(CC) $(FLAGS) $(OBJ) $(LIBS) -o $@
$(LIBFT):
$(MAKE) all clean -C libft/
%.o: %.c $(HEADER)
$(CC) $(FLAGS) -c $(INCLUDES) $< -o $@
clean:
rm -f $(OBJ)
fclean: clean
rm -f $(NAME) $(LIBFT)
re: fclean all
.PHONY: all clean fclean re