-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
63 lines (43 loc) · 1.42 KB
/
Makefile
File metadata and controls
63 lines (43 loc) · 1.42 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
CC = cc
CFLAGS = -Wall -Werror -Wextra
RM = rm -rf
NAME = so_long
HEADER = so_long.h
SRC = src/main.c src/map_parsing.c src/utils.c src/map_check_path.c \
src/map_flood_fill.c src/game.c src/image.c src/map_build.c \
src/move.c
OBJ = $(SRC:%.c=%.o)
BONUS = so_long
BONUS_H = bonus_so_long.h
BONUS_SRC = bonus/main.c bonus/utils.c bonus/image.c bonus/map_check_path.c \
bonus/map_parsing.c bonus/enemies.c bonus/map_flood_fill.c bonus/game.c \
bonus/map_build.c bonus/move.c bonus/chicken.c
BONUS_OBJ = $(BONUS_SRC:.c=.o)
LIBFT = lib/libft/libft.a
FT_PRINTF = lib/ft_printf/libftprintf.a
MLX = mlx/libmlx.a
all: libft ft_printf $(NAME)
bonus: libft ft_printf $(BONUS_OBJ) $(MLX)
$(CC) $(CFLAGS) $(BONUS_OBJ) $(LIBFT) $(FT_PRINTF) -Lmlx -lmlx -framework OpenGL -framework AppKit -o $(BONUS)
$(NAME): $(OBJ) $(MLX)
$(CC) $(CFLAGS) $(OBJ) $(LIBFT) $(FT_PRINTF) -Lmlx -lmlx -framework OpenGL -framework AppKit -o $(NAME)
%.o: %.c $(HEADER)
$(CC) $(CFLAGS) -Imlx -c $< -o $@
libft:
@$(MAKE) -C lib/libft/
ft_printf:
@$(MAKE) -C lib/ft_printf/
$(MLX):
@$(MAKE) -C mlx/
clean:
@$(RM) $(OBJ) $(BONUS_OBJ)
@$(MAKE) -C lib/libft/ clean
@$(MAKE) -C lib/ft_printf/ clean
@$(MAKE) -C mlx clean
fclean: clean
@$(MAKE) -C lib/libft/ fclean
@$(MAKE) -C lib/ft_printf/ fclean
@$(MAKE) -C mlx clean
@$(RM) $(NAME) $(BONUS)
re: fclean all
.PHONY: all clean fclean re bonus