-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
executable file
·57 lines (43 loc) · 1.79 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
# **************************************************************************** #
# #
# ::: :::::::: #
# Makefile :+: :+: :+: #
# +:+ +:+ +:+ #
# By: mgras <[email protected]> +#+ +:+ +#+ #
# +#+#+#+#+#+ +#+ #
# Created: 2015/12/07 18:34:51 by mgras #+# #+# #
# Updated: 2016/01/31 21:45:09 by nromptea ### ########.fr #
# #
# **************************************************************************** #
SRC_NAME = ft_initiate_tab.c ft_move_down.c ft_move_left.c ft_move_up.c\
ft_move_right.c ft_core.c ft_check.c ft_choice.c ft_grid_maker.c\
ft_loop.c ft_menu.c
OBJ_NAME = $(SRC_NAME:.c=.o)
LIB_NAME = libft
SRC_PATH = ./src/
OBJ_PATH = ./obj/
LIB_PATH = ./libft/
INC_PATH = ./include/ $(LIB_PATH)
SRC = $(addprefix $(SRC_PATH), $(SRC_NAME))
OBJ = $(addprefix $(OBJ_PATH), $(OBJ_NAME))
INC = $(addprefix -I, $(INC_PATH))
LIB = $(addprefix -L, $(LIB_PATH))
NAME = game_2048
CC = gcc
CFLAGS = -Wall -Wextra -Werror
LDFLAGS = -lft
all: libft $(NAME)
.PHONY: libft clean fclean re $(NAME)
libft :
make -C $(LIB_PATH)
$(NAME): $(OBJ)
$(CC) $(CFLAGS) -lncurses $(OBJ) $(LIB) $(INC) $(LDFLAGS) -o $(NAME)
$(OBJ_PATH)%.o : $(SRC_PATH)%.c
@mkdir -p $(OBJ_PATH)
$(CC) $(CFLAGS) $(INC) -o $@ -c $<
clean :
@$(RM) -v $(OBJ)
@$(RM) -rv $(OBJ_PATH)
fclean : clean
@$(RM) -v $(NAME)
re: fclean all