-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathMakefile
87 lines (70 loc) · 2.28 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
81
82
83
84
85
86
87
# **************************************************************************** #
# #
# ::: :::::::: #
# Makefile :+: :+: :+: #
# +:+ +:+ +:+ #
# By: vifonne <[email protected]> +#+ +:+ +#+ #
# +#+#+#+#+#+ +#+ #
# Created: 2019/02/23 03:29:11 by vifonne #+# #+# #
# Updated: 2019/02/23 04:45:21 by gguichar ### ########.fr #
# #
# **************************************************************************** #
NAME = corewar_project
ASM = asm
ASM_DIR = asm_dir
DASM = dasm
DASM_DIR = dasm_dir
VM = corewar
VM_DIR = vm_dir
UNDER = $'\x1b[4m$'
RED = $'\x1b[31m$'
GREEN = $'\x1b[32m$'
YELLOW = $'\x1b[33m$'
WHITE = $'\x1b[37m$'
END = $'\x1b[0m$'
LIBFT = libft/libft.a
CC = gcc
CFLAGS = -Wall -Wextra -Werror
all: $(NAME)
$(NAME): $(LIBFT) $(VM) $(ASM) $(DASM)
$(VM):
@echo "\n$(UNDER)Compiling vm:$(END)\n"
@$(MAKE) -C $(VM_DIR)
@cp $(VM_DIR)/$(VM) .
$(ASM):
@echo "\n$(UNDER)Compiling asm:$(END)\n"
@$(MAKE) -C $(ASM_DIR)
@cp $(ASM_DIR)/$(ASM) .
$(DASM):
@echo "\n$(UNDER)Compiling dasm:$(END)\n"
@$(MAKE) -C $(DASM_DIR)
@cp $(DASM_DIR)/$(DASM) .
$(LIBFT):
@echo "\n$(UNDER)Compiling libft:$(END)\n"
@$(MAKE) -C libft
clean:
@echo "$(UNDER)Cleaning project:$(END)\n"
@echo "$(YELLOW)"
@echo "Cleaning libft"
@$(MAKE) -C libft clean
@$(MAKE) -C $(ASM_DIR) clean
@$(MAKE) -C $(DASM_DIR) clean
@$(MAKE) -C $(VM_DIR) clean
@echo "$(END)"
fclean: clean
@echo "\n$(UNDER)Full clean project:$(END)\n"
@echo "$(RED)"
@echo "Full clean libft"
@$(MAKE) -C libft fclean
@$(MAKE) -C $(ASM_DIR) fclean
@$(MAKE) -C $(DASM_DIR) fclean
@$(MAKE) -C $(VM_DIR) fclean
@echo "$(END)"
@echo "\n$(UNDER)Cleaning exec in current directory:$(END)\n"
@echo "$(RED)"
/bin/rm -f $(ASM)
/bin/rm -f $(DASM)
/bin/rm -f $(VM)
@echo "$(END)"
re: fclean all
.PHONY: all clean fclean re $(NAME) $(VM) $(ASM) $(DASM)