-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
43 lines (31 loc) · 792 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 = Odyci
OBJS_DIR = .objs
SRCS = main.cpp \
srcs/Game.cpp \
srcs/Player.cpp \
srcs/Map.cpp
OBJS = $(addprefix $(OBJS_DIR)/, $(SRCS:%.cpp=%.o))
CXX = g++
CXXFLAGS = -lsfml-graphics -lsfml-window -lsfml-system -lglfw -lGL #-g -fsanitize=address
RED = \033[0;31m
ORANGE=\033[0;33m
GREEN = \033[0;32m
NC = \033[0m
all: $(NAME)
$(NAME): $(OBJS)
@$(CXX) $(OBJS) -o $(NAME) $(CXXFLAGS)
@echo "$(GREEN)Executable $(NAME) created successfully.$(NC)"
$(OBJS_DIR)/%.o: %.cpp
@mkdir -p $(dir $@)
@$(CXX) $(CXXFLAGS) -c $< -o $@
@echo "$(ORANGE)Compiled $< to $@$(NC)"
clean:
@rm -f $(NAME)
@echo "$(RED)Cleaned executable file.$(NC)"
fclean: clean
@rm -rf $(OBJS_DIR)
@echo "$(RED)Cleaned project files.$(NC)"
re: fclean all
run: all
./$(NAME)
.PHONY: all clean fclean re