-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
78 lines (63 loc) · 2.13 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
75
76
77
78
# **************************************************************************** #
# #
# ::: :::::::: #
# Makefile :+: :+: :+: #
# +:+ +:+ +:+ #
# By: ji-kim <marvin@42.fr> +#+ +:+ +#+ #
# +#+#+#+#+#+ +#+ #
# Created: 2021/07/05 17:24:50 by ji-kim #+# #+# #
# Updated: 2021/07/05 17:25:30 by ji-kim ### ########.fr #
# #
# **************************************************************************** #
NAME = minishell
CC = gcc
CFLAGS = -Wall -Wextra #-Werror
LIBFT = libft.a
INCLUDE = includes/
SRCS_DIR = ./srcs/
RL = -lreadline
RL_DIR = /Users/$(USER)/.brew/opt/readline/
RL_LIB = -L $(RL_DIR)lib
RL_INC = -I $(RL_DIR)include
SRCS = $(addprefix $(SRCS_DIR),\
builtin.c\
builtin_util.c\
env.c\
eof_handler.c\
exec.c\
init0.c init1.c\
list.c\
logo.c\
loop.c\
minishell.c\
parse0.c parse1.c\
pipe.c\
redirection0.c redirection1.c\
sig_handler.c\
utils0.c utils1.c\
)
OBJS = $(SRCS:.c=.o)
DEPS = $(SRCS:.c=.d)
#mine
RL_M1 = -L/usr/local/opt/readline/lib
RL_M2 = -I//usr/local/opt/readline/include
all : $(NAME)
$(NAME) : $(OBJS) $(LIBFT)
@$(CC) $(CFLAGS) $(OBJS) -o $@ -L. -lft $(RL) $(RL_LIB) -lncurses
mine : $(OBJS) $(LIBFT)
@$(CC) $(CFLAGS) $(OBJS) -o $(NAME) -L. -lft $(RL) $(RL_M1) -lncurses
$(LIBFT) :
@make all -C ./libft
@cp ./libft/libft.h $(INCLUDE)
@cp ./libft/libft.a ./
clean :
@make clean -C ./libft
@rm -f $(OBJS) $(DEPS)
fclean : clean
@rm -f $(LIBFT) ./libft/libft.a
@rm -f $(NAME)
re : fclean all
.c.o :
@$(CC) $(CFLAGS) -MD -c -o $@ $< -I$(INCLUDE) $(RL_INC) $(RL_M2)
-include $(DEPS)
.PHONY: all clean fclean re