This repository has been archived by the owner on Aug 28, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 8
/
Jamfile
251 lines (212 loc) · 7.21 KB
/
Jamfile
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
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
#---- setup ----
#This portion of the Jamfile sets up compiler and linker flags per-OS.
#You shouldn't need to change it.
if $(OS) = NT { #Windows
NEST_LIBS = ..\\nest-libs\\windows ;
C++FLAGS = /nologo /Z7 /c /EHsc /W3 /WX /MD
#disable a few warnings:
/wd4146 #-1U is still unsigned
/wd4297 #unforunately SDLmain is nothrow
#/wd4267 #loss of precision warning is a bit too annoying sometimes
;
LINKFLAGS = /nologo /SUBSYSTEM:CONSOLE /DEBUG:FASTLINK
;
LINKLIBS =
;
#SDL2:
C++FLAGS += /I"$(NEST_LIBS)/SDL2/include" ;
LINKLIBS += SDL2main.lib SDL2.lib OpenGL32.lib ;
LINKFLAGS += /LIBPATH:"$(NEST_LIBS)/SDL2/lib" ;
File README-SDL.txt : $(NEST_LIBS)\\SDL2\\dist\\README-SDL.txt ;
MakeLocate README-SDL.txt : dist ;
File SDL2.dll : $(NEST_LIBS)\\SDL2\\dist\\SDL2.dll ;
MakeLocate SDL2.dll : dist ;
File <other>SDL2.dll : $(NEST_LIBS)\\SDL2\\dist\\SDL2.dll ;
MakeLocate <other>SDL2.dll : scenes ;
#glm:
C++FLAGS += /I"$(NEST_LIBS)/glm/include" ;
File README-glm.txt : $(NEST_LIBS)\\glm\\dist\\README-glm.txt ;
MakeLocate README-glm.txt : dist ;
#libpng:
C++FLAGS += /I"$(NEST_LIBS)/libpng/include" ;
LINKLIBS += libpng.lib zlib.lib ;
LINKFLAGS += /LIBPATH:"$(NEST_LIBS)/libpng/lib" /LIBPATH:"$(NEST_LIBS)/zlib/lib" ;
File README-libpng.txt : $(NEST_LIBS)\\libpng\\dist\\README-libpng.txt ;
MakeLocate README-libpng.txt : dist ;
#opusfile:
C++FLAGS += /I"$(NEST_LIBS)/opusfile/include" ;
LINKLIBS += opusfile.lib ;
LINKFLAGS += /LIBPATH:"$(NEST_LIBS)/opusfile/lib" ;
File README-opusfile.txt : $(NEST_LIBS)\\opusfile\\dist\\README-opusfile.txt ;
MakeLocate README-opusfile.txt : dist ;
#libogg:
C++FLAGS += /I"$(NEST_LIBS)/libogg/include" ;
LINKLIBS += libogg.lib ;
LINKFLAGS += /LIBPATH:"$(NEST_LIBS)/libogg/lib" ;
File README-libogg.txt : $(NEST_LIBS)\\libogg\\dist\\README-libogg.txt ;
MakeLocate README-libogg.txt : dist ;
#libopus:
C++FLAGS += /I"$(NEST_LIBS)/libopus/include" ;
LINKLIBS += opus.lib ;
LINKFLAGS += /LIBPATH:"$(NEST_LIBS)/libopus/lib" ;
File README-libopus.txt : $(NEST_LIBS)\\libopus\\dist\\README-libopus.txt ;
MakeLocate README-libopus.txt : dist ;
} else if $(OS) = MACOSX { #MacOS
NEST_LIBS = ../nest-libs/macos ;
C++ = clang++ ;
C++FLAGS = -std=c++14 -g -Wall -Werror ;
LINK = clang++ ;
LINKFLAGS = -std=c++14 -g -Wall -Werror ;
LINKLIBS = ;
#SDL2:
C++FLAGS += `'$(NEST_LIBS)/SDL2/bin/sdl2-config' --prefix='$(NEST_LIBS)/SDL2' --cflags` ;
LINKLIBS += `'$(NEST_LIBS)/SDL2/bin/sdl2-config' --prefix='$(NEST_LIBS)/SDL2' --static-libs` -framework OpenGL ;
File README-SDL.txt : $(NEST_LIBS)/SDL2/dist/README-SDL.txt ;
MakeLocate README-SDL.txt : dist ;
#glm:
C++FLAGS += -I$(NEST_LIBS)/glm/include ;
File README-glm.txt : $(NEST_LIBS)/glm/dist/README-glm.txt ;
MakeLocate README-glm.txt : dist ;
#libpng:
C++FLAGS += -I$(NEST_LIBS)/libpng/include ;
LINKLIBS += -L$(NEST_LIBS)/libpng/lib -lpng -L$(NEST_LIBS)/zlib/lib -lz ;
File README-libpng.txt : $(NEST_LIBS)/libpng/dist/README-libpng.txt ;
MakeLocate README-libpng.txt : dist ;
#opusfile:
C++FLAGS += -I$(NEST_LIBS)/opusfile/include ;
LINKLIBS += -L$(NEST_LIBS)/opusfile/lib -lopusfile ;
File README-opusfile.txt : $(NEST_LIBS)/opusfile/dist/README-opusfile.txt ;
MakeLocate README-opusfile.txt : dist ;
#libogg:
C++FLAGS += -I$(NEST_LIBS)/libogg/include ;
LINKLIBS += -L$(NEST_LIBS)/libogg/lib -logg ;
File README-libogg.txt : $(NEST_LIBS)/libogg/dist/README-libogg.txt ;
MakeLocate README-libogg.txt : dist ;
#libopus:
C++FLAGS += -I$(NEST_LIBS)/libopus/include ;
LINKLIBS += -L$(NEST_LIBS)/libopus/lib -lopus ;
File README-libopus.txt : $(NEST_LIBS)/libopus/dist/README-libopus.txt ;
MakeLocate README-libopus.txt : dist ;
} else if $(OS) = LINUX { #Linux
NEST_LIBS = ../nest-libs/linux ;
C++ = g++ -no-pie ;
C++FLAGS = -std=c++17 -g -Wall -Werror ;
LINK = g++ -no-pie ;
LINKFLAGS = -std=c++17 -g -Wall -Werror ;
LINKLIBS = ;
#various nest libs, split into their own lines for ease of commenting-out-when-not-needed:
#SDL2:
C++FLAGS += `'$(NEST_LIBS)/SDL2/bin/sdl2-config' --prefix='$(NEST_LIBS)/SDL2' --cflags` ;
LINKLIBS += `'$(NEST_LIBS)/SDL2/bin/sdl2-config' --prefix='$(NEST_LIBS)/SDL2' --static-libs` -lGL ;
File README-SDL.txt : $(NEST_LIBS)/SDL2/dist/README-SDL.txt ;
MakeLocate README-SDL.txt : dist ;
#glm:
C++FLAGS += -I$(NEST_LIBS)/glm/include ;
File README-glm.txt : $(NEST_LIBS)/glm/dist/README-glm.txt ;
MakeLocate README-glm.txt : dist ;
#libpng:
C++FLAGS += -I$(NEST_LIBS)/libpng/include ;
LINKLIBS += -L$(NEST_LIBS)/libpng/lib -lpng -L$(NEST_LIBS)/zlib/lib -lz ;
File README-libpng.txt : $(NEST_LIBS)/libpng/dist/README-libpng.txt ;
MakeLocate README-libpng.txt : dist ;
#opusfile:
C++FLAGS += -I$(NEST_LIBS)/opusfile/include ;
LINKLIBS += -L$(NEST_LIBS)/opusfile/lib -lopusfile ;
File README-opusfile.txt : $(NEST_LIBS)/opusfile/dist/README-opusfile.txt ;
MakeLocate README-opusfile.txt : dist ;
#libogg:
C++FLAGS += -I$(NEST_LIBS)/libogg/include ;
LINKLIBS += -L$(NEST_LIBS)/libogg/lib -logg ;
File README-libogg.txt : $(NEST_LIBS)/libogg/dist/README-libogg.txt ;
MakeLocate README-libogg.txt : dist ;
#libopus:
C++FLAGS += -I$(NEST_LIBS)/libopus/include ;
LINKLIBS += -L$(NEST_LIBS)/libopus/lib -lopus ;
File README-libopus.txt : $(NEST_LIBS)/libopus/dist/README-libopus.txt ;
MakeLocate README-libopus.txt : dist ;
}
#---- build ----
#This is the part of the file that tells Jam how to build your project.
#Store the names of all the .cpp files to build into a variable:
GAME_NAMES =
demo_menu
DemoLightingMultipassMode
BasicMaterialProgram
DemoLightingForwardMode
BasicMaterialForwardProgram
LightMeshes
DemoLightingDeferredMode
BasicMaterialDeferredProgram
CopyToScreenProgram
BoneAnimation
PlantMode
Sound
load_wav
load_opus
DrawSprites
ColorTextureProgram
LitColorTextureProgram
BoneLitColorTextureProgram
Sprite
MenuMode
main
data_path
;
#Uncomment if you want to build a second "client" program for multiplayer stuff
#CLIENT_NAMES =
# ClientMode
# Sound
# load_wav
# load_opus
# DrawSprites
# ColorTextureProgram
# LitColorTextureProgram
# Sprite
# client
# data_path
# ;
COMMON_NAMES =
Connection
PathFont
PathFont-font
DrawLines
ColorProgram
Scene
Mesh
make_vao_for_program
load_save_png
gl_compile_program
Mode
GL
Load
;
SHOW_MESHES_NAMES =
show-meshes
ShowMeshesProgram
ShowMeshesMode
;
SHOW_SCENE_NAMES =
show-scene
ShowSceneProgram
ShowSceneMode
;
PACK_SPRITES_NAMES =
pack-sprites
;
LOCATE_TARGET = objs ; #put objects in 'objs' directory
Objects
$(GAME_NAMES:S=.cpp)
#$(CLIENT_NAMES:S=.cpp)
$(COMMON_NAMES:S=.cpp)
$(SHOW_MESHES_NAMES:S=.cpp)
$(SHOW_SCENE_NAMES:S=.cpp)
$(PACK_SPRITES_NAMES:S=.cpp)
;
LOCATE_TARGET = dist ; #put in 'dist' directory
MainFromObjects demo : $(GAME_NAMES:S=$(SUFOBJ)) $(COMMON_NAMES:S=$(SUFOBJ)) ;
#MainFromObjects client : $(CLIENT_NAMES:S=$(SUFOBJ)) $(COMMON_NAMES:S=$(SUFOBJ)) ;
LOCATE_TARGET = sprites ; #put pack-sprites utility in the 'sprites' directory:
MainFromObjects pack-sprites : $(PACK_SPRITES_NAMES:S=$(SUFOBJ)) load_save_png$(SUFOBJ) ;
LOCATE_TARGET = scenes ; #put show-meshes and show-scene utilities in the 'scenes' directory:
MainFromObjects show-meshes : $(SHOW_MESHES_NAMES:S=$(SUFOBJ)) $(COMMON_NAMES:S=$(SUFOBJ)) ;
MainFromObjects show-scene : $(SHOW_SCENE_NAMES:S=$(SUFOBJ)) $(COMMON_NAMES:S=$(SUFOBJ)) ;