-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
66 lines (53 loc) · 1.39 KB
/
Makefile
File metadata and controls
66 lines (53 loc) · 1.39 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
63
64
65
66
NAME := termin_snake
SRCS := \
sources/game/game_init.c \
sources/game/game_delete.c \
sources/winlist/winlist_init.c \
sources/winlist/winlist_delete.c \
sources/snake/snake_init.c \
sources/snake/snake_delete.c \
sources/snake/snake_move.c \
sources/snake/snake_has_to_die.c \
sources/snake/snake_draw.c \
sources/snake/snake_grow.c \
sources/snake/snake_can_eat.c \
sources/handler/handler.c \
sources/handler/handler_quit.c \
sources/handler/handler_up.c \
sources/handler/handler_down.c \
sources/handler/handler_right.c \
sources/handler/handler_left.c \
sources/handler/handler_pause.c \
sources/gameloop/update.c \
sources/gameloop/draw.c \
sources/gameloop/draw_pause.c \
sources/gameloop/draw_gameover.c \
sources/food/food_spawn.c \
sources/food/food_draw.c \
sources/main.c
OBJS := $(SRCS:.c=.o)
CC := gcc
CFLAGS := -Wall -Wextra -Werror -g #-fsanitize=address,undefined
CPPFLAGS := -I./includes -lncurses
RM := rm -f
MAKEFLAGS += --no-print-directory
all : $(NAME)
$(NAME) : $(OBJS)
$(CC) $(OBJS) $(CFLAGS) $(CPPFLAGS) -o $(NAME)
$(info CREATED $(NAME))
%.o : %.c
$(CC) $(CFLAGS) -c $< -o $@
$(info CREATED $@)
clean :
$(RM) $(OBJS)
$(info DELETED objects files)
fclean : clean
$(RM) $(NAME)
$(info DELETED $(NAME))
re :
$(MAKE) fclean
$(MAKE) all
info-%:
$(MAKE) --dry-run --always-make $* | grep -v "info"
.PHONY : clean fclean re info-
.SILENT :