-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
55 lines (42 loc) · 1.78 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
# **************************************************************************** #
# #
# ::: :::::::: #
# Makefile :+: :+: :+: #
# +:+ +:+ +:+ #
# By: bbellavi <[email protected]> +#+ +:+ +#+ #
# +#+#+#+#+#+ +#+ #
# Created: 2020/09/29 01:50:06 by tlucille #+# #+# #
# Updated: 2020/12/10 13:02:38 by bbellavi ### ########.fr #
# #
# **************************************************************************** #
CC = gcc
CFLAGS = -Wall -Werror -Wextra
EXT_DIR = externals
INC_DIR = includes
SRC_DIR = srcs
LIBFT_DIR = $(EXT_DIR)/libft
FT_INC_DIR = $(LIBFT_DIR)/includes
LEXER_DIR = $(SRC_DIR)/lexer
PARSE_DIR = $(SRC_DIR)/parser
EVAL_DIR = $(SRC_DIR)/eval
READ_DIR = $(SRC_DIR)/reader
OUTPUT_DIR = $(SRC_DIR)/output
BUILTIN_DIR = $(SRC_DIR)/builtins
LIBFT_NAME = libft.a
NAME = minishell
SRCS = main.c
include $(SRC_DIR)/module.mk $(READ_DIR)/module.mk $(LEXER_DIR)/module.mk $(PARSE_DIR)/module.mk $(BUILTIN_DIR)/module.mk $(EVAL_DIR)/module.mk $(OUTPUT_DIR)/module.mk
.PHONY: all clean fclean
all: $(NAME)
$(NAME): $(SRCS)
@make -C $(LIBFT_DIR)
@mv $(LIBFT_DIR)/$(LIBFT_NAME) .
@$(CC) $(CFLAGS) -o $(NAME) $(SRCS) $(LIBFT_NAME) -I$(INC_DIR) -I$(FT_INC_DIR)
clean:
@rm -f $(LIBFT_NAME)
@make -C $(LIBFT_DIR) clean
fclean: clean
@rm -f $(NAME)
@rm -rf $(NAME).dSYM
@make -C $(LIBFT_DIR) fclean
re: fclean all