-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
51 lines (29 loc) · 1.09 KB
/
Makefile
File metadata and controls
51 lines (29 loc) · 1.09 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
NAME = so_long
SRC = so_long.c textures.c map.c utils.c game.c movement.c floodfill.c \
./get_next_line/get_next_line.c ./get_next_line/get_next_line_utils.c \
PRINTF = ./ft_printf/libftprintf.a
CC = cc
CFLAGS = #-Wall -Wextra -Werror
all : ${NAME}
%.o:%.c
$(CC) $(CFLAGS) -c $< -o $@
$(PRINTF) :
make -C ./ft_printf
OBJ = ${SRC:.c=.o}
$(NAME): $(OBJ) $(PRINTF)
$(CC) $(PRINTF) $(OBJ) -L/usr/local/lib -lmlx -lXext -lX11 -lm -o $(NAME)
clean :
rm -f ${OBJ} $(OBJ_BONUS)
make clean -C ./ft_printf
fclean : clean
rm -f ${NAME} $(NAME_BONUS)
make fclean -C ./ft_printf
re : fclean all
NAME_BONUS = so_long_bonus
SRC_BONUS = ./bonus/so_long_bonus.c ./bonus/utils_bonus.c ./bonus/textures_bonus.c ./bonus/movement_bonus.c ./bonus/map_bonus.c ./bonus/game_bonus.c ./bonus/floodfill_bonus.c \
./get_next_line/get_next_line.c ./get_next_line/get_next_line_utils.c \
bonus : $(NAME_BONUS)
OBJ_BONUS = $(SRC_BONUS:.c=.o)
$(NAME_BONUS) : $(OBJ_BONUS) $(PRINTF)
$(CC) $(PRINTF) $(OBJ_BONUS) -lmlx -framework OpenGL -framework AppKit -o $(NAME_BONUS)
.SECONDARY: $(OBJ) $(OBJ_BONUS)