-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
65 lines (57 loc) · 2.74 KB
/
Makefile
File metadata and controls
65 lines (57 loc) · 2.74 KB
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
# **************************************************************************** #
# #
# ::: :::::::: #
# Makefile :+: :+: :+: #
# +:+ +:+ +:+ #
# By: kko <kko@student.42.fr> +#+ +:+ +#+ #
# +#+#+#+#+#+ +#+ #
# Created: 2022/11/09 15:22:25 by seokchoi #+# #+# #
# Updated: 2023/01/09 11:07:37 by kko ### ########.fr #
# #
# **************************************************************************** #
SRCS = main.c initial.c loop.c
SRCS_BULT= ft_cd.c ft_echo.c ft_env.c ft_export.c ft_pwd.c ft_unset.c \
export_util.c ft_exit.c ft_export_util.c
SRCS_ENV= ft_split_for_env.c env.c free.c env_arr.c check_env.c ft_unset_env_list.c
SRCS_ERR= err.c err_msg_syntax_int.c
SRCS_EXE= built_run.c exec.c here_doc.c ioctl.c open_redir.c open_util.c \
path.c pipe_util.c run_pipe.c run.c
SRCS_PAR= check_list.c check_list2.c check_subshell_redir.c check_wave.c \
cmd.c cut_cmd.c delete_comma_check_env.c ft_strjoin_space.c \
init_token.c is_type.c key_util.c malloc_utils.c oper_type.c \
parse_utility.c push_index_about_comma.c redirection.c \
redirection2.c token_list_len.c token_util.c tree_check.c \
tree_recursion.c tree_util.c wildcard.c wildcard_dir.c
SRCS_FREE= free.c utility.c
SOURCE = srcs/
SRC_ENV = srcs/env/
SRC_PAR = srcs/parse/
SRC_BULT= srcs/builtin/
SRC_EXE= srcs/exec/
SRC_ERR= srcs/error/
SRC_FREE= srcs/free/
OBJS = ${addprefix ${SOURCE},${SRCS:.c=.o}} ${addprefix ${SRC_ENV},${SRCS_ENV:.c=.o}} \
${addprefix ${SRC_PAR},${SRCS_PAR:.c=.o}} ${addprefix ${SRC_BULT},${SRCS_BULT:.c=.o}} \
${addprefix ${SRC_EXE},${SRCS_EXE:.c=.o}} ${addprefix ${SRC_ERR},${SRCS_ERR:.c=.o}} \
${addprefix ${SRC_FREE},${SRCS_FREE:.c=.o}}
CC = cc
CFLAGS = -Wall -Werror -Wextra
NAME = minishell
HEAD = includes
LIBFT = libft
all: ${NAME}
.c.o: ${SRCS}
# ${CC} $(CFLAGS) -I ${HEAD} -c $^ -o ${^:.c=.o}
${CC} $(CFLAGS) -I ${HEAD} -c $^ -o ${^:.c=.o} -I/Users/kko/.brew/opt/readline/include
${NAME}: ${OBJS}
make -C ${LIBFT}/
# $(CC) $(CFLAGS) -I $(HEAD) -o $(NAME) ${OBJS} -L ./libft -lft -lreadline
$(CC) $(CFLAGS) -I $(HEAD) -o $(NAME) ${OBJS} -L/Users/kko/.brew/opt/readline/lib -lreadline -L ./libft -lft
clean:
make clean -C ${LIBFT}/
rm -f ${OBJS}
fclean: clean
make fclean -C ${LIBFT}/
rm -f ${NAME}
re: fclean all
.PHONY: all clean fclean re