-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
43 lines (31 loc) · 819 Bytes
/
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
NAME = snake
MAIN = srcs/main.c
GAMEPLAY = $(wildcard srcs/gameplay/*.c)
INPUTS = $(wildcard srcs/inputs/*.c)
UTILS = $(wildcard srcs/utils/*.c)
GRAPHIC = $(wildcard srcs/graphic/*.c)
SRC = $(UTILS) $(GRAPHIC) $(GAMEPLAY) $(INPUTS) $(MAIN)
HDRS = $(wildcard incl/*.h)
OBJ = $(SRC:.c=.o)
RM = rm -f
%.o: %.c
gcc -Wall -Wextra -Werror -Imlx -I ${HDRS} -c $< -o $@
$(NAME): $(OBJ)
@(make -C ./mlx/mlxo/) 2> /dev/null
@gcc $(OBJ) -Lmlx -lmlx -framework OpenGL -framework AppKit -o $(NAME)
@echo "\033[92m$(NAME) compiled succesfully.\033[0m"
all: $(NAME)
clean:
@${RM} $(OBJ)
@make -C ./mlx/mlxo/ clean
clean2:
@${RM} $(NAME) ${OBJ}
fclean: clean
@${RM} $(NAME) ${OBJ}
@make -C ./mlx/mlxo/ clean
re: clean2
@make all
git:
@git add srcs/ incl/*.h mlx/ Makefile
git status
.PHONY: all clean fclean re