-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
68 lines (49 loc) · 1.77 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
# **************************************************************************** #
# #
# ::: :::::::: #
# Makefile :+: :+: :+: #
# +:+ +:+ +:+ #
# By: aulamber <aulamber@student.42.fr> +#+ +:+ +#+ #
# +#+#+#+#+#+ +#+ #
# Created: 2014/04/27 19:56:54 by aulamber #+# #+# #
# Updated: 2014/05/18 23:39:17 by aulamber ### ########.fr #
# #
# **************************************************************************** #
NAME = ft_minishell2
SRC = ./
INCDIR = includes/
SOURCE = main.c \
other_functions.c \
builtins.c \
builtin_cd.c \
other1.c \
other2.c \
other3.c \
OBJ = $(SOURCE:.c=.o)
LIBDIR = libft/
LIB = $(LIBDIR)libft.a
LIB_COMP = -L ./$(LIBDIR) -lft
CC = gcc
FLAG = -I $(INCDIR) -Wall -Wextra -Werror -g
RED = \033[33;31m
BLUE = \033[33;34m
GREEN = \033[33;32m
RESET = \033[0m
.PHONY: all re fclean
all: $(NAME)
$(LIB):
@$(MAKE) -C $(LIBDIR)
$(NAME): $(LIB) $(OBJ)
@$(CC) -o $(NAME) $(FLAG) $^ $(LIB_COMP)
@echo "[$(GREEN)Compilation $(BLUE)$(NAME) $(GREEN)ok$(RESET)]"
%.o: %.c
@$(CC) -c -o $@ $(FLAG) $^
clean:
@cd $(LIBDIR) && $(MAKE) $@
@rm -f $(OBJ)
@echo "[$(RED)Supression des .o de $(BLUE)$(NAME) $(GREEN)ok$(RESET)]"
fclean: clean
@cd $(LIBDIR) && $(MAKE) $@
@rm -f $(NAME)
@echo "[$(RED)Supression de $(BLUE)$(NAME) $(GREEN)ok$(RESET)]"
re: fclean all