-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
56 lines (45 loc) · 1.89 KB
/
Makefile
File metadata and controls
56 lines (45 loc) · 1.89 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
# **************************************************************************** #
# #
# ::: :::::::: #
# Makefile :+: :+: :+: #
# +:+ +:+ +:+ #
# By: mjacques <mjacques@student.42.fr> +#+ +:+ +#+ #
# +#+#+#+#+#+ +#+ #
# Created: 2018/07/09 11:32:00 by mjacques #+# #+# #
# Updated: 2018/11/11 09:27:49 by mcarney ### ########.fr #
# #
# **************************************************************************** #
CC = gcc
RM = rm -rf
NAME = 42sh
CFLAGS = -Wall -Wextra -Werror -g
LIBFT = libft/libft.a
INCLUDES = -I includes/\
-I libft/header
BASE = main.c ft_util.c
BUILTINS = ft_builtins.c ft_envp.c ft_envp_tools.c ft_helper.c
EXECUTE = ft_command.c ft_tokens_exec.c ft_tokens_fct.c ft_tokens_tools.c\
ft_expand.c ft_here_document.c
PARSER = ft_validate_input.c ft_tokenizer.c ft_ast.c ft_check_backquote.c\
ft_tokenizer_util.c
HISTORY = ft_history.c ft_history_tools.c ft_history_check.c
FUNCTIONS = $(BASE) $(BUILTINS) $(EXECUTE) $(PARSER) $(HISTORY)
FILES = $(addprefix srcs/, $(FUNCTIONS))
OBJECTS = $(FILES:.c=.o)
.PHONY: all clean fclean re
all: $(NAME)
%.o: %.c
@$(CC) $(CFLAGS) $(INCLUDES) -c $< -o $@
$(NAME): $(OBJECTS) $(LIBFT)
@$(CC) $(CFLAGS) -o $(NAME) $(OBJECTS) $(LIBFT)
@echo "\033[32m42sh compiled!\033[0m"
$(LIBFT):
@make -C libft/
clean:
@$(RM) $(OBJECTS)
@make clean -C libft/
fclean: clean
@$(RM) $(NAME)
@make fclean -C libft/
@echo "\033[31m42sh cleaned!\033[0m"
re: fclean all