-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
73 lines (55 loc) · 2.21 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
#******************************************************************************#
# #
# ::: :::::::: #
# Makefile :+: :+: :+: #
# +:+ +:+ +:+ #
# By: ciglesia <[email protected]> +#+ +:+ +#+ #
# +#+#+#+#+#+ +#+ #
# Created: 2019/08/08 22:49:10 by ciglesia #+# #+# #
# Updated: 2020/09/01 13:14:57 by ciglesia ### ########.fr #
# #
#******************************************************************************#
NAME = lem-in
INC = ./include/
INC2 = ./libft/include/
INCLUDE = -I $(INC2) -I $(INC)
SUB_MAKE = ./libft/
INC_LIB = -L$(SUB_MAKE) -lft
DIROBJ = ./depo/
DIRSRC = ./src/
DIRFARM = ./src/farm/
DIRGRAPH = ./src/graph/
DIRSOLVE = ./src/solve/
SRC = lem_in.c
FARM = farm_treatment.c valid_input.c
GRAPH = graph_treatment.c attrib.c list.c print.c
SOLVE = solve.c valid_solution.c bfs.c bfs_treatment.c flow.c flow_treatment.c path_computation.c
OAUX = $(SRC:%=$(DIROBJ)%) $(FARM:%=$(DIROBJ)%) $(GRAPH:%=$(DIROBJ)%) $(SOLVE:%=$(DIROBJ)%)
DEPS = $(OAUX:.c=.d)
OBJS = $(OAUX:.c=.o)
CFLAGS = -Wall -Wextra -Werror
CC = /usr/bin/gcc
RM = /bin/rm -f
%.o : ../$(DIRSRC)/%.c
$(CC) $(CFLAGS) $(INCLUDE) -MMD -o $@ -c $<
%.o : ../$(DIRFARM)/%.c
$(CC) $(CFLAGS) $(INCLUDE) -MMD -o $@ -c $<
%.o : ../$(DIRGRAPH)/%.c
$(CC) $(CFLAGS) $(INCLUDE) -MMD -o $@ -c $<
%.o : ../$(DIRSOLVE)/%.c
$(CC) $(CFLAGS) $(INCLUDE) -MMD -o $@ -c $<
$(NAME) : submake $(OBJS)
@$(CC) $(INCLUDE) $(CFLAGS) -o $(NAME) $(OBJS) $(INC_LIB)
clean :
@$(RM) $(OBJS)
@$(RM) $(DEPS)
@(cd $(SUB_MAKE) && $(MAKE) clean)
all : $(NAME)
fclean : clean
@$(RM) $(NAME)
@(cd $(SUB_MAKE) && $(MAKE) fclean)
re : fclean $(NAME)
@(cd $(SUB_MAKE) && $(MAKE) re)
submake :
@(cd $(SUB_MAKE) && $(MAKE))
.PHONY : all clean fclean re