-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile.bak
148 lines (117 loc) · 3.62 KB
/
Makefile.bak
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
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
########################################
## SETUP MAKEFILE
## Set the appropriate TARGET (our
## executable name) and any OBJECT files
## we need to compile for this program.
##
## Next set the path to our local
## include/, lib/, and bin/ folders.
## (If you we are compiling in the lab,
## then you can ignore these values.
## They are only for if you are
## compiling on your personal machine.)
##
## Set if we are compiling in the lab
## environment or not. Set to:
## 1 - if compiling in the Lab
## 0 - if compiling at home
##
## Finally, set the flags for which
## libraries you are using and want to
## compile against.
########################################
TARGET = guild
OBJECTS = main.o utils/context.o heroes/Antikythera.o utils/ControlPoint.o utils/Point.o utils/bezierCurveReader.o utils/bezierCurve.o utils/Direction.o heroes/AntikytheraPet.o
LOCAL_INC_PATH = /Users/jpaone/Desktop/include
LOCAL_LIB_PATH = /Users/jpaone/Desktop/lib
LOCAL_BIN_PATH = /Users/jpaone/Desktop/bin
BUILDING_IN_LAB = 1
USING_OPENGL = 1
USING_GLUI = 0
ifeq ($(USER), rybailey)
LOCAL_INC_PATH = /usr/include
LOCAL_LIB_PATH = /usr/lib
LOCAL_BIN_PATH = /usr/bin
BUILDING_IN_LAB = 0
endif
#########################################################################################
#########################################################################################
#########################################################################################
##
## !!!STOP!!!
## THERE IS NO NEED TO MODIFY ANYTHING BELOW THIS LINE
## IT WILL WORK FOR YOU. TRUST ME
#############################
## COMPILING INFO
#############################
CXX = g++
CFLAGS = -Wall -std=c++11 -g
INCPATH += -I./include
LAB_INC_PATH = C:/sw/opengl/include
LAB_LIB_PATH = C:/sw/opengl/lib
LAB_BIN_PATH = C:/sw/opengl/bin
# if we are not building in the Lab
ifeq ($(BUILDING_IN_LAB), 0)
# and we are running Windows
ifeq ($(OS), Windows_NT)
# then set our lab paths to our local paths
# so the Makefile will still work seamlessly
LAB_INC_PATH = $(LOCAL_INC_PATH)
LAB_LIB_PATH = $(LOCAL_LIB_PATH)
LAB_BIN_PATH = $(LOCAL_BIN_PATH)
endif
endif
#############################
## SETUP OpenGL & GLUT
#############################
# if we are using OpenGL & GLUT in this program
ifeq ($(USING_OPENGL), 1)
# Windows builds
ifeq ($(OS), Windows_NT)
INCPATH += -I$(LAB_INC_PATH)
LIBPATH += -L$(LAB_LIB_PATH)
LIBS += -lglut -lopengl32 -lglu32
# Mac builds
else ifeq ($(shell uname), Darwin)
LIBS += -framework GLUT -framework OpenGL
# Linux and all other builds
else
LIBS += -lglut -lGL -lGLU
endif
endif
#############################
## SETUP GLUI
#############################
# if we are using OpenGL & GLUT in this program
ifeq ($(USING_GLUI), 1)
# Windows builds
ifeq ($(OS), Windows_NT)
INCPATH += -I$(LAB_INC_PATH)
LIBPATH += -L$(LAB_LIB_PATH)
# Linux and all other builds
else
INCPATH += -I$(LOCAL_INC_PATH)
LIBPATH += -L$(LOCAL_LIB_PATH)
endif
LIBS += -lglui
endif
#############################
## COMPILATION INSTRUCTIONS
#############################
all: $(TARGET)
clean:
rm -f $(OBJECTS) $(TARGET)
depend:
rm -f Makefile.bak
mv Makefile Makefile.bak
sed '/^# DEPENDENCIES/,$$d' Makefile.bak > Makefile
echo '# DEPENDENCIES' >> Makefile
$(CXX) $(INCPATH) -MM *.cpp >> Makefile
.c.o:
$(CXX) $(CFLAGS) $(INCPATH) -c -o $@ $<
.cc.o:
$(CXX) $(CFLAGS) $(INCPATH) -c -o $@ $<
.cpp.o:
$(CXX) $(CFLAGS) $(INCPATH) -c -o $@ $<
$(TARGET): $(OBJECTS)
$(CXX) $(CFLAGS) $(INCPATH) -o $@ $^ $(LIBPATH) $(LIBS)