-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
73 lines (57 loc) · 1.81 KB
/
Copy pathMakefile
File metadata and controls
73 lines (57 loc) · 1.81 KB
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: cdelamar <[email protected]> +#+ +:+ +#+ #
# +#+#+#+#+#+ +#+ #
# Created: 2024/04/10 21:54:20 by cdelamar #+# #+# #
# Updated: 2024/05/13 17:12:30 by cdelamar ### ########.fr #
# #
# **************************************************************************** #
NAME = so_long
LIBFT = lib/libft.a
LIBMLXLINUX = lib/libmlx_Linux.a
CC = cc
CFLAGS = -g -Wall -Wextra -Werror \
-Iinclude
LFLAGS = -Llib \
-lft -lmlx_Linux -lX11 -lXext
SRC_DIR = src/
OBJ_DIR = obj/
FILES = main \
control \
error_args \
error_map \
free \
ft_gnl \
gnl \
init_map \
init_sprite \
output \
clone \
flood_fill \
ft_hexa \
ft_put \
ft_ptr \
ft_printf \
ft_custom
SRCS = $(addprefix $(SRC_DIR), $(addsuffix .c, $(FILES)))
OBJS = $(addprefix $(OBJ_DIR), $(addsuffix .o, $(FILES)))
all: $(NAME)
clean :
@rm -rf $(OBJ_DIR)
fclean : clean
@rm -rf $(NAME)
@make fclean -C lib
re: fclean all
$(NAME): $(OBJS) $(LIBFT) $(LIBMLXLINUX)
@echo "\033[32m✔ Compilating sources files...\033[37m"
@$(CC) -o $@ $(OBJS) $(LFLAGS)
@echo "\033[32m✔ Executable created.\033[37m"
$(LIBFT):
@make -C lib
obj/%.o: src/%.c
@mkdir -p $(dir $@)
@$(CC) $(CFLAGS) -c $< -o $@
.PHONY: all clean fclean re bonus