-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
executable file
·80 lines (66 loc) · 1.8 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
79
80
# Program
NAME := minishell
# Necessities
CC := cc
CFLAGS = -Wall -Wextra -Werror -Wpedantic -g3 #-fsanitize=address,undefined
OS := $(shell uname)
Dar = Darwin
Lin = Linux
HOME_DIR := $(shell echo ~)
ifeq (${OS}, ${Dar})
CFLAGS += -L${HOME_DIR}/homebrew/opt/readline/lib -I${HOME_DIR}/homebrew/opt/readline/include
else ifeq (${OS}, ${Lin})
CFLAGS += -lreadline -lcurses
else
$(error Idk, man. Doesn't look like something I was BUILT to deal with ;3)
endif
SRC := main.c list_utils.c pipe_at_eol.c init_msh.c msh.c \
pipe_at_eol_norme_dump.c \
$(addprefix parsing/, \
tokenizer.c parser.c parser_utils.c parse_word_utils.c\
tokenizer_helper.c token_list_utils.c parse_env_spaces.c \
skip_dummies.c \
) \
$(addprefix interpreter/, \
interpreter.c pipes.c words.c \
prepare.c redirections.c \
\
$(addprefix processor_norme_dump/, \
interpret_dump.c \
heredoc_dump.c \
word_dump.c \
heredoc_env_expansion.c \
) \
) \
$(addprefix wrappers/, \
wrapper_utils.c wrappers.c \
$(addprefix wrapper_norme_dump/, \
wrapper_dump.c \
) \
) \
$(addprefix builtins/, \
builtins_cd.c builtins_pwd.c builtins_env.c \
builtins_echo.c builtins_utils.c \
$(addprefix builtins_norme_dump/, \
builtin_dump.c \
) \
) \
destroy.c show_errors.c \
#$(addprefix wrappers_norme_dump/,
# wrapper_dump.c
#)
SRCS := $(addprefix srcs/, $(SRC))
INC := minishell.h parser.h interpreter.h
INCLUDES := $(addprefix includes/, $(INC)) libft/includes/libft.h
# Rules
all : $(NAME)
$(NAME) : $(SRCS) $(INCLUDES)
@make -C libft
$(CC) $(CFLAGS) -Iincludes $(SRCS) -Llibft -Ilibft/includes -lft -o $@ -lreadline -lcurses
clean :
@make -C libft clean
fclean :
@make -C libft fclean
@rm -rf $(NAME)
re : fclean all
.PHONY : all clean fclean re