-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
129 lines (103 loc) · 2.98 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
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
# **************************************************************************** #
# #
# ::: :::::::: #
# Makefile :+: :+: :+: #
# +:+ +:+ +:+ #
# By: ybarbier <[email protected]> +#+ +:+ +#+ #
# +#+#+#+#+#+ +#+ #
# Created: 2016/03/04 16:13:54 by ybarbier #+# #+# #
# Updated: 2017/06/08 15:56:38 by ybarbier ### ########.fr #
# #
# **************************************************************************** #
#____________CONFIG____________#
NAME_NM = ft_nm
NAME_OTOOL = ft_otool
PATH_SRC = ./src/
PATH_INC = ./inc/
PATH_INC_LIBFT = ./libft/includes/
INCLUDES = -I $(PATH_INC) -I $(PATH_INC_LIBFT)
CC = cc
ifeq ($(DEBUG),yes)
CFLAGS = $(INCLUDES) -g
LDFLAGS = -shared
else
CFLAGS = -Wall -Wextra -Werror $(INCLUDES)
LDFLAGS = -shared
endif
LIBS = -L libft/ -lft -lm
#____________FILES____________#
SRC_NM = nm.c \
utils_file.c \
utils_memory.c \
display_common_symbol.c \
display_common_section.c \
display_common_hexa.c \
display_nm.c \
format_information_1.c \
format_information_2.c \
format_information_3.c \
format_information_ar_1.c \
format_information_ar_2.c \
format_information_ar_3.c \
format_information_symbol.c \
handler_format.c \
handler_macho.c \
handler_fat.c \
handler_ar.c \
init_format.c \
section_list.c \
symbol_list.c \
ft_puthexa_size.c \
ft_print_mem.c \
swap.c \
init_file.c \
archive_list.c \
checker.c
SRC_OTOOL = otool.c \
utils_file.c \
utils_memory.c \
display_common_symbol.c \
display_common_section.c \
display_common_hexa.c \
display_otool.c \
format_information_1.c \
format_information_2.c \
format_information_3.c \
format_information_ar_1.c \
format_information_ar_2.c \
format_information_ar_3.c \
format_information_symbol.c \
handler_format.c \
handler_macho.c \
handler_fat.c \
handler_ar.c \
init_format.c \
section_list.c \
symbol_list.c \
ft_puthexa_size.c \
ft_print_mem.c \
swap.c \
init_file.c \
archive_list.c \
checker.c
OBJ_NM = $(addprefix $(PATH_SRC), $(SRC_NM:.c=.o))
OBJ_OTOOL = $(addprefix $(PATH_SRC), $(SRC_OTOOL:.c=.o))
#____________RULES____________#
.PHONY: clean fclean re
all: $(NAME_NM) $(NAME_OTOOL)
$(NAME_NM): $(OBJ_NM)
make -C libft/
$(CC) $(OBJ_NM) -o $(NAME_NM) $(LIBS)
$(NAME_OTOOL): $(OBJ_OTOOL)
make -C libft/
$(CC) $(OBJ_OTOOL) -o $(NAME_OTOOL) $(LIBS)
#___CLEAN___#
clean:
rm -f $(OBJ_NM)
rm -f $(OBJ_OTOOL)
#___FCLEAN___#
fclean: clean
rm -f $(NAME_NM)
rm -f $(NAME_OTOOL)
#___RE___#
re: fclean all