This repository has been archived by the owner on Jun 6, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
60 lines (42 loc) · 2.34 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
CC := g++
OBJ := obj
SRC := src
INC := include
CFLAGS := -std=c++17 -lm -g -lGL -lGLU -lglut -Wall -pedantic -Wextra -Wno-unused-parameter
EXE := trabalhocg
PROJETO := main
all: clean $(OBJ)/gunshot.o $(OBJ)/$(PROJETO).o $(OBJ)/game.o $(OBJ)/character.o $(OBJ)/terrain.o $(OBJ)/svg_reader.o $(OBJ)/utils.o $(OBJ)/player.o $(OBJ)/enemy.o $(OBJ)/tinyxml2.o ## Create objects from all source code files from scratch and link them in the final program
$(CC) $(OBJ)/*.o -o $(EXE) $(CFLAGS)
$(OBJ)/$(PROJETO).o: $(PROJETO).cpp
$(CC) -c $(CFLAGS) $(PROJETO).cpp -o "$(OBJ)/$(PROJETO).o"
$(OBJ)/game.o: $(SRC)/game.cpp $(INC)/game.hpp
$(CC) -c $(CFLAGS) "$(SRC)/game.cpp" -o "$(OBJ)/game.o"
$(OBJ)/gunshot.o: $(SRC)/gunshot.cpp $(INC)/gunshot.hpp
$(CC) -c $(CFLAGS) "$(SRC)/gunshot.cpp" -o "$(OBJ)/gunshot.o"
$(OBJ)/character.o: $(SRC)/character.cpp $(INC)/character.hpp
$(CC) -c $(CFLAGS) "$(SRC)/character.cpp" -o "$(OBJ)/character.o"
$(OBJ)/terrain.o: $(SRC)/terrain.cpp $(INC)/terrain.hpp
$(CC) -c $(CFLAGS) "$(SRC)/terrain.cpp" -o "$(OBJ)/terrain.o"
$(OBJ)/svg_reader.o: $(SRC)/svg_reader.cpp $(INC)/svg_reader.hpp
$(CC) -c $(CFLAGS) "$(SRC)/svg_reader.cpp" -o "$(OBJ)/svg_reader.o"
$(OBJ)/utils.o: $(SRC)/utils.cpp $(INC)/utils.hpp
$(CC) -c $(CFLAGS) "$(SRC)/utils.cpp" -o "$(OBJ)/utils.o"
$(OBJ)/player.o: $(SRC)/player.cpp $(INC)/player.hpp
$(CC) -c $(CFLAGS) "$(SRC)/player.cpp" -o "$(OBJ)/player.o"
$(OBJ)/enemy.o: $(SRC)/enemy.cpp $(INC)/enemy.hpp
$(CC) -c $(CFLAGS) "$(SRC)/enemy.cpp" -o "$(OBJ)/enemy.o"
$(OBJ)/tinyxml2.o: $(SRC)/tinyxml2.cpp $(INC)/tinyxml2.hpp
$(CC) -c $(CFLAGS) "$(SRC)/tinyxml2.cpp" -o "$(OBJ)/tinyxml2.o"
run: all ## Compile and run executable with input/arena_teste.svg
./$(EXE) input/arena_teste.svg
debug: all ## Compile and run executable with input/arena_teste.svg in debug mode
./$(EXE) input/arena_teste.svg -d
exe: ## Run executable with input/arena_teste.svg
./$(EXE) input/arena_teste.svg
release: clean ## Compress code in a .zip file for distribution
-tar -cvf AtilioAntonioDadalto.zip include/* input/arena_teste.svg obj/ src/* LICENSE main.cpp Makefile README.md
help: ## Display help message
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-10s\033[0m %s\n", $$1, $$2}'
clean: ## Clean objects and executables
-rm -f $(OBJ)/*.o
-rm -f $(EXE)