-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
70 lines (55 loc) · 2.04 KB
/
Makefile
File metadata and controls
70 lines (55 loc) · 2.04 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
67
68
69
70
# **************************************************************************** #
# #
# ::: :::::::: #
# Makefile :+: :+: :+: #
# +:+ +:+ +:+ #
# By: p <p@student.42.fr> +#+ +:+ +#+ #
# +#+#+#+#+#+ +#+ #
# Created: 2015/05/12 23:33:03 by p #+# #+# #
# Updated: 2015/07/26 19:00:22 by p ### ########.fr #
# #
# **************************************************************************** #
NAME = npuzzle
# Compilation settings
CC = clang++ -std=c++11
CFLAGS = -Werror -Wextra -Wall -O3
# Custom paths
DIR_SRCS = srcs/
DIR_OBJS = objs/
DIR_INCS = -Iincs/
#------------------------------------------------------------------------------#
FILES = main.cpp \
Grid.cpp \
Solver.cpp \
Parser.cpp \
Heuristics.cpp \
Exceptions.cpp \
#------------------------------------------------------------------------------#
# Apply custom paths
SRCS = $(addprefix $(DIR_SRCS), $(FILES))
OBJS = $(addprefix $(DIR_OBJS), $(FILES:.cpp=.o))
# Colors
RED = \x1b[31;01m
GREEN = \x1b[32;01m
CYAN = \x1b[34;01m
RESET = \x1b[39;49;00m
# Rules
all: $(NAME)
$(NAME): $(OBJS)
@ printf "Linking "
@ $(CC) $(OBJS) $(CFLAGS) $(DIR_INCS) -o $(NAME)
@ printf "$(GREEN)DONE$(RESET)\n"
@ echo "Program $(RED)$(NAME)$(RESET) -> $(GREEN)COMPLETED$(RESET)"
$(DIR_OBJS)%.o: $(DIR_SRCS)%.cpp
@ echo "Building $(CYAN)$< $(RESET)"
@ mkdir -p $(DIR_OBJS)
@ $(CC) $(CFLAGS) $(DIR_INCS) -c $< -o $@
clean:
@ rm -f $(OBJS)
@ rm -rf $(DIR_OBJS)
@ echo "Clean $(GREEN)DONE$(RESET)"
fclean: clean
@ rm -f $(NAME)
@ echo "Fclean $(GREEN)DONE$(RESET)"
re: fclean all
.PHONY: all clean fclean re