-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
64 lines (50 loc) · 1.74 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
# **************************************************************************** #
# #
# ::: :::::::: #
# Makefile :+: :+: :+: #
# +:+ +:+ +:+ #
# By: alida-si <[email protected]> +#+ +:+ +#+ #
# +#+#+#+#+#+ +#+ #
# Created: 2022/02/25 21:26:57 by alida-si #+# #+# #
# Updated: 2022/03/05 20:09:28 by alida-si ### ########.fr #
# #
# **************************************************************************** #
NAME = so_long
LIBFT_DIR = ./libft
LIBFT = ./libft/libft.a
SRC_DIR = ./src
OBJ_DIR = ./obj
SRC_FILES = so_long.c \
error_msg.c \
check_map.c \
check_mp_utils_I.c \
check_mp_utils_II.c \
create_matrix.c \
init_game.c \
key_events.c \
init_values.c \
close.c \
load_map.c \
SRC = $(addprefix $(SRC_DIR)/, $(SRC_FILES))
OBJ = $(SRC:$(SRC_DIR)/%.c=$(OBJ_DIR)/%.o)
CC = gcc
CCFLAGS = -Wall -Wextra -Werror
MLXFLAGS = -lmlx -lXext -lX11
LIBFLAGS = -L./libft -lft
RM = rm -f
RM_DIR = rm -rf
all: $(NAME)
$(NAME): $(LIBFT) $(OBJ)
$(CC) $(CCFLAGS) -o $(NAME) $(OBJ) $(MLXFLAGS) $(LIBFLAGS)
$(OBJ_DIR)/%.o: $(SRC_DIR)/%.c
mkdir -p $(OBJ_DIR)
$(CC) $(CCFLAGS) -c $< -o $@
$(LIBFT):
make -C ./libft
clean:
make clean -C $(LIBFT_DIR)
$(RM_DIR) $(OBJ_DIR)
fclean: clean
make fclean -C $(LIBFT_DIR)
$(RM) $(NAME)
re: fclean all