-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
58 lines (43 loc) · 1.86 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
# **************************************************************************** #
# LE - / #
# / #
# Makefile .:: .:/ . .:: #
# +:+:+ +: +: +:+:+ #
# By: bodibon <[email protected]> +:+ +: +: +:+ #
# #+# #+ #+ #+# #
# Created: 2018/10/31 15:47:43 by bodibon #+# ## ## #+# #
# Updated: 2018/11/19 12:20:36 by bodibon ### #+. /#+ ###.fr #
# / #
# / #
# **************************************************************************** #
NAME_1 = lem-in
SDIR = ./srcs/
IDIR = ./includes/
LDIR = ./libft/
ODIR = ./obj/
SRCS = $(addsuffix .c, alloc_01 alloc_02 bsop_01 bsop_02 bsop_03 \
colony_walk compute_path_op \
display_sol_01 display_sol_02 error free_01 free_02 \
get_room_att main parse_01 parse_02 path_utility \
set_colony sort_valves valves valves_02 \
trivial_sol dfs_01 dfs_02)
HEADERS = $(addsuffix .h, lem_in)
OBJ_1 = $(addprefix $(ODIR), $(SRCS:.c=.o))
LIB = libft.a
CC = gcc
CFLAGS = -Wall -Wextra -Werror -o2
all: $(LIB) $(NAME_1)
$(NAME_1): $(OBJ_1)
$(CC) $(addprefix $(LDIR), $(LIB)) $(CFLAGS) $(OBJ_1) -o $@
$(LIB):
make -C $(LDIR)
$(addprefix $(ODIR), %.o): $(addprefix $(SDIR), %.c) $(addprefix $(IDIR), $(HEADERS))
mkdir -p $(ODIR)
$(CC) -I $(IDIR) $(CFLAGS) -c $< -o $@
clean:
rm -rf $(ODIR)
make -C $(LDIR) clean
fclean: clean
rm -f $(NAME_1) $(NAME_2)
make -C $(LDIR) fclean
re: fclean all