-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
65 lines (45 loc) · 1.78 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
# **************************************************************************** #
# #
# ::: :::::::: #
# Makefile :+: :+: :+: #
# +:+ +:+ +:+ #
# By: yhliboch <[email protected]> +#+ +:+ +#+ #
# +#+#+#+#+#+ +#+ #
# Created: 2018/11/20 16:19:46 by yhliboch #+# #+# #
# Updated: 2018/12/12 16:21:27 by omaltsev ### ########.fr #
# #
# **************************************************************************** #
NAME := fillit
SRC_DIR := ./src/
OBJ_DIR := ./obj/
LIB_DIR := ./lib/
INK_DIR := ./ink/
SRC := main.c check_tetrimino.c options.c options2.c matrix.c dancing_links.c square.c cover_uncover.c make_matrix.c
OBJ = $(addprefix $(OBJ_DIR), $(SRC:.c=.o))
LIBFT = $(LIBFT_DIR)libft.a
LIBFT_DIR := $(LIB_DIR)libft/
LIBFT_INK := $(LIBFT_DIR)includes/
LIBFT_FLAGS := -lft -L $(LIBFT_DIR)
FLAGS := -Wall -Wextra -Werror
LINK_FLAGS := $(LIBFT_FLAGS)
HEADER_FLAGS := -I $(INK_DIR) -I $(LIBFT_INK)
CC := gcc
all: $(NAME)
$(NAME): $(LIBFT) $(OBJ)
@$(CC) $(FLAGS) $(OBJ) $(LINK_FLAGS) -o $(NAME)
$(OBJ): | $(OBJ_DIR)
$(OBJ_DIR):
@mkdir $(OBJ_DIR)
$(OBJ_DIR)%.o: %.c
@$(CC) -c $< -o $@ $(CC_FLAGS) $(HEADER_FLAGS)
$(LIBFT):
@make -C $(LIBFT_DIR)
clean:
@rm -f $(OBJ)
@make clean -C $(LIBFT_DIR)
fclean: clean
@rm -f $(NAME)
@rm -rf $(OBJ_DIR)
@make fclean -C $(LIBFT_DIR)
re: fclean all
vpath %.c $(SRC_DIR)