-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
55 lines (44 loc) · 1.33 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
GREEN = /bin/echo -e "\x1b[1;3;32m$1\x1b[0m"
CC = gcc
CFLAGS = -Wall -Werror -Wextra
SRC = srcs/normal/main.c \
srcs/normal/parse_map.c \
srcs/normal/init_vars.c \
srcs/normal/check_map.c \
srcs/normal/put_map.c \
srcs/normal/play.c \
srcs/normal/close_win.c \
SRC_BONUS = srcs/bonus/main_bonus.c \
srcs/bonus/parse_map_bonus.c \
srcs/bonus/init_vars_bonus.c \
srcs/bonus/check_map_bonus.c \
srcs/bonus/put_map_bonus.c \
srcs/bonus/play_bonus.c \
srcs/bonus/close_win_bonus.c \
srcs/bonus/ft_animation.c \
OBJ = $(SRC:.c=.o)
OBJ_BONUS = $(SRC_BONUS:.c=.o)
NAME = srcs/so_long
LIB = libft/libft.a
all: $(NAME)
%.o: %.c
$(CC) $(CFLAGS) -I/usr/include -Imlx_linux -O3 -c $< -o $@
$(NAME): $(OBJ)
make -C ./libft
$(CC) $(OBJ) $(LIB) -Lmlx_linux -lmlx_Linux -L/usr/lib -Imlx_linux -lXext -lX11 -lm -lz -o $(NAME)
$(call GREEN,"Compilation success 😁")
bonus: $(OBJ_BONUS)
make -C ./libft
$(CC) $(OBJ_BONUS) $(LIB) -Lmlx_linux -lmlx_Linux -L/usr/lib -Imlx_linux -lXext -lX11 -lm -lz -o $(NAME)
$(call GREEN,"Compilation success 😁")
clean:
make clean -C ./libft
rm -f $(OBJ) $(OBJ_BONUS)
$(call GREEN,"The .o cleaned up !")
fclean: clean
make fclean -C ./libft
rm -f $(NAME)
$(call GREEN,"The rest too !")
re: fclean all
.SILENT:
.PHONY: all clean fclean re