forked from decadane/Lem-in
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
51 lines (36 loc) · 1.45 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
# **************************************************************************** #
# #
# ::: :::::::: #
# Makefile :+: :+: :+: #
# +:+ +:+ +:+ #
# By: marvin <[email protected]> +#+ +:+ +#+ #
# +#+#+#+#+#+ +#+ #
# Created: 2019/01/29 19:04:47 by ffahey #+# #+# #
# Updated: 2019/02/06 14:16:52 by ffahey ### ########.fr #
# #
# **************************************************************************** #
NAME = lem-in
vpath %.c srcs
vpath %.h includes
vpath %.o bin
FLAGS = -Wall -Wextra -Werror
OBJ = $(addprefix bin/,$(notdir $(patsubst %.c,%.o,$(wildcard srcs/*.c))))
HEADERS = $(wildcard includes/*.h)
LIB = libft/libft.a
all: makedir make_lib $(NAME)
makedir:
@mkdir -p bin
make_lib:
make -C libft/
$(NAME): $(OBJ) $(LIB)
gcc $(FLAGS) $^ -o $@ -Iincludes -Ilibft -Llibft -lft
bin/%.o: %.c $(HEADERS)
gcc $(FLAGS) -c $< -o $@ -Iincludes -Ilibft
clean:
rm -rf bin/
rm -rf libft/*.o
fclean: clean
rm -f $(NAME)
rm -f $(LIB)
re: fclean all
.PHONY: all clean fclean re make_lib