-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
executable file
·68 lines (55 loc) · 1.85 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
65
66
67
68
# **************************************************************************** #
# #
# ::: :::::::: #
# Makefile :+: :+: :+: #
# +:+ +:+ +:+ #
# By: dalves-p <[email protected]> +#+ +:+ +#+ #
# +#+#+#+#+#+ +#+ #
# Created: 2021/09/17 17:10:18 by dalves-p #+# #+# #
# Updated: 2021/11/11 16:57:29 by dalves-p ### ########.fr #
# #
# **************************************************************************** #
NAME = so_long
CC = clang
SRCS = srcs/so_long.c \
srcs/key_manager.c \
srcs/maps.c \
srcs/validate_map.c \
srcs/error.c \
srcs/movements.c \
srcs/game.c \
srcs/free_map.c \
srcs/enemy.c \
srcs/enemy_move.c \
srcs/animation.c \
LIBFT = libft/libft.a
CFLAGS = -Wall -Wextra -Werror
MLXFLAGS = -L ./mlx/ -lmlx -framework OpenGL -framework AppKit -lz
RM = rm -f
OBJS = $(SRCS:%.c=%.o)
ifeq ($(shell uname), Linux)
MLXFLAGS = -L ./mlx_linux/ -lmlx -Ilmlx -lXext -lX11
endif
all: $(NAME)
$(NAME): $(OBJS)
make -C libft
make clean -C libft
$(CC) $(SRCS) $(LIBFT) $(MLXFLAGS) $(CFLAGS) -o $(NAME)
%o: %.c
$(CC) $(CFLAGS) -Imlx -c $< -o $@
run: all
./$(NAME) maps/map_bonus.ber
clean:
$(RM) $(OBJS)
fclean: clean
$(RM) $(NAME)
$(RM) *.out
make fclean -C libft/
re: fclean all
git:
@git add .
@git commit -m "$m"
@git push
@echo "Commit sent to github"
# To call: make git m="my commit"
.PHONY: all clean fclean re