-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
122 lines (95 loc) · 3.7 KB
/
Makefile
File metadata and controls
122 lines (95 loc) · 3.7 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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
# This sample Makefile allows you to make an OpenGL application
#
# To use this Makefile, you type:
#
# make -to compile all of the code for Homework 2
# make run -to compile and then run the program
# make release -to compile just the binary for running the program
# make debug -to keep all of the object files
#
# Assumes the following file exists in the proper place.
srcpth = ./Graphics/source/
headerpth = ./Graphics/headers/
angel = ./Graphics/angel/include/
gamelogicpth = ./GameLogic/
# What compiler do you want to use for c++ files?
CC = g++
# Compiler options -g for debug info
GCC_OPTIONS= -pedantic -g
# What libraries to link GLU is included for backwards compatibility
#LDLIBS = -lGL -lGLU /usr/lib/x86_64-linux-gnu/libglut.so.3 /usr/lib/x86_64-linux-gnu/libGLEWmx.so.1.13
LDLIBS = -lGL -lGLU -lGLEW /usr/lib/x86_64-linux-gnu/libglut.so.3
#LDLIBS = -lGL -lGLU -lGLEW -lGLUT
# program to link in compiling all binaries that initialize shaders
InitShader = ./Graphics/angel/Common/InitShader.o
# Where to find the include files
INCS = -I /usr/include/ -I $(angel) -I $(headerpth) -I $(gamelogicpth)
# options to pass to the compiler (all the gcc ones, and the where to
# find the includes).
OPTIONS=$(GCC_OPTIONS) $(INCS) -Wall -std=c++17
OBJECTS = $(patsubst %.cc,%,$(wildcard *.cc))
all: Termobjs homework2
release: all clean
run: release
./homework2
##############Terminal game make##########################
Termbuild:Termgame
Termobjs: game.o othello.o termspace.o
Termgame: main.o Termobjs
g++ main.o game.o othello.o termspace.o -o game
main.o: $(gamelogicpth)main.cpp
g++ -c $(gamelogicpth)main.cpp
game.o: $(gamelogicpth)game.cpp $(gamelogicpth)game.h
g++ -c $(gamelogicpth)game.cpp
othello.o: $(gamelogicpth)othello.cpp $(gamelogicpth)colors.h space.o
g++ -c $(gamelogicpth)othello.cpp
termspace.o: $(gamelogicpth)space.h $(gamelogicpth)space.cpp
g++ -c $(gamelogicpth)space.cpp -o termspace.o
###########################################################
################Start Graphic code compliation###########
camera.o: $(srcpth)camera.cc $(headerpth)camera.h
$(CC) $(srcpth)camera.cc -c $(OPTIONS)
scene.o :$(srcpth)scene.cc $(headerpth)scene.h
$(CC) $(srcpth)scene.cc -c $(OPTIONS)
############### In world Objects ######################
object.o: $(headerpth)object.h $(srcpth)object.cc
$(CC) $(srcpth)object.cc -c $(OPTIONS)
cube.o: $(headerpth)cube.h \
$(srcpth)cube.cc \
object.o
$(CC) $(srcpth)cube.cc -c $(INCS) $(OPTIONS)
cube_door.o:$(headerpth)cube_door.h \
$(srcpth)cube_door.cc \
object.o
$(CC) $(srcpth)cube_door.cc -c $(INCS) $(OPTIONS)
sphere.o: $(headerpth)sphere.h \
$(srcpth)sphere.cc \
object.o
$(CC) $(srcpth)sphere.cc -c $(INCS) $(OPTIONS)
piece.o: $(headerpth)piece.h \
$(srcpth)piece.cc \
object.o
$(CC) $(srcpth)piece.cc -c $(INCS) $(OPTIONS)
space.o: $(headerpth)space.h \
$(srcpth)space.cc \
object.o
$(CC) $(srcpth)space.cc -c $(INCS) $(OPTIONS)
board.o: $(headerpth)board.h \
$(srcpth)board.cc \
object.o
$(CC) $(srcpth)board.cc -c $(INCS) $(OPTIONS)
####################################################################
homework2: object.o $(headerpth)object.h \
cube.o $(headerpth)cube.h \
scene.o $(headerpth)scene.h \
sphere.o $(headerpth)sphere.h \
cube_door.o $(headerpth)cube_door.h \
camera.o $(headerpth)camera.h \
piece.o $(headerpth)piece.h \
board.o $(headerpth)board.h \
space.o $(headerpth)space.h
$(CC) Homework2.cc *.o $(InitShader) $(INCS) $(OPTIONS) $(LDLIBS) -o homework2
clean:
rm -f $(OBJECTS) *.o *~
squeakyclean: clean
rm -f homework2 game