Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 512 lines (433 sloc) 18.134 kb
8fa358a @johnmccutchan Initial cut of NaCL build configuration
johnmccutchan authored
1 include config/version
2
3 SHELL = /bin/sh
4 ifeq ($(NACL_PACKAGES_BITSIZE), 32)
5 SYSTEM = nacl-32
b3f40a3 @johnmccutchan Build fixes
johnmccutchan authored
6 BIN_EXTENSION = .x86.nexe
9a64a10 @johnmccutchan Remove unnecessary -melf64_nacl
johnmccutchan authored
7 CFLAGS.EXTRA = -m32
8fa358a @johnmccutchan Initial cut of NaCL build configuration
johnmccutchan authored
8 else
9 SYSTEM = nacl-64
b3f40a3 @johnmccutchan Build fixes
johnmccutchan authored
10 BIN_EXTENSION = .x64.nexe
9a64a10 @johnmccutchan Remove unnecessary -melf64_nacl
johnmccutchan authored
11 CFLAGS.EXTRA = -m64
f0ce5e0 @johnmccutchan Demo cleanups
johnmccutchan authored
12 #CFLAGS.EXTRA = -m64 -DREGAL_DEBUG=0 -DREGAL_ERROR=0 -DREGAL_LOG=0 -DREGAL_NO_ASSERT -DREGAL_LOG_APP=0 -DREGAL_LOG_DRIVER=0 -DREGAL_INTERNAL=0 -DREGAL_LOG_HTTP=0
8fa358a @johnmccutchan Initial cut of NaCL build configuration
johnmccutchan authored
13 endif
14 REGAL_NACL = 1
15 SYSTEM.SUPPORTED = $(shell test -f config/Makefile.$(SYSTEM) && echo 1)
16
17 ifeq ($(SYSTEM.SUPPORTED), 1)
18 include config/Makefile.$(SYSTEM)
19 else
20 $(error "Platform '$(SYSTEM)' not supported")
21 endif
22
23 REGAL_DEST ?= /usr
24 BINDIR ?= $(REGAL_DEST)/bin
25 LIBDIR ?= $(REGAL_DEST)/lib
26
27 # To disable stripping of binaries either:
28 # - use STRIP= on gmake command-line
29 # - edit this makefile to set STRIP to the empty string
30 #
31 # To disable symlinks:
32 # - use LN= on gmake command-line
33
34 AR ?= ar
35 INSTALL ?= install
36 STRIP ?= strip
37 RM ?= rm -f
38 LN ?= ln -sf
39
e4655bc @johnmccutchan Make fixes
johnmccutchan authored
40 CFLAGS.EXTRA += -fno-exceptions -fno-rtti
8fa358a @johnmccutchan Initial cut of NaCL build configuration
johnmccutchan authored
41 ifeq ($(MAKECMDGOALS), debug)
42 OPT = -g
43 STRIP :=
44 else
45 OPT = $(POPT)
46 endif
47 INCLUDE = -Iinclude
48 CFLAGS = $(OPT) $(WARN) $(INCLUDE) $(CFLAGS.EXTRA)
49
50 all debug: regal.lib regal.bin
51
52 # REGAL shared and static libraries
53
54 export:
55 scripts/Export.py --api gl 4.2 --api wgl 4.0 --api glx 4.0 --api cgl 1.4 --api egl 1.0 --outdir src/regal
56
e4655bc @johnmccutchan Make fixes
johnmccutchan authored
57 LIB.LDFLAGS := -lstdc++ -lpthread -ldl -lm -lppapi_gles2
8fa358a @johnmccutchan Initial cut of NaCL build configuration
johnmccutchan authored
58 LIB.LIBS :=
59
60 LIB.SRCS :=
61 LIB.SRCS += src/regal/RegalIff.cpp
62 LIB.SRCS += src/regal/Regal.cpp
63 LIB.SRCS += src/regal/RegalToken.cpp
64 LIB.SRCS += src/regal/RegalLog.cpp
65 LIB.SRCS += src/regal/RegalInit.cpp
66 LIB.SRCS += src/regal/RegalUtil.cpp
67 LIB.SRCS += src/regal/RegalConfig.cpp
68 LIB.SRCS += src/regal/RegalLookup.cpp
69 LIB.SRCS += src/regal/RegalHelper.cpp
70 LIB.SRCS += src/regal/RegalContext.cpp
71 LIB.SRCS += src/regal/RegalContextInfo.cpp
72 LIB.SRCS += src/regal/RegalDispatchEmu.cpp
73 LIB.SRCS += src/regal/RegalDispatchLog.cpp
74 LIB.SRCS += src/regal/RegalDispatchDebug.cpp
75 LIB.SRCS += src/regal/RegalDispatchError.cpp
76 LIB.SRCS += src/regal/RegalDispatchLoader.cpp
9a64a10 @johnmccutchan Remove unnecessary -melf64_nacl
johnmccutchan authored
77 LIB.SRCS += src/regal/RegalDispatchNacl.cpp
78 LIB.SRCS += src/regal/RegalDispatchMissing.cpp
8fa358a @johnmccutchan Initial cut of NaCL build configuration
johnmccutchan authored
79 LIB.SRCS += src/regal/RegalHttp.cpp
80 LIB.SRCS += src/regal/RegalFavicon.cpp
81
82 ifneq ($(REGAL_NACL), 1)
83 LIB.SRCS += src/mongoose/mongoose.c
84 LIB.INCLUDE += -Isrc/mongoose
85 endif
86
87 LIB.SRCS.NAMES := $(notdir $(LIB.SRCS))
88
89 LIB.INCLUDE += -Isrc/boost
90
91 LIB.DEPS :=
92 LIB.DEPS += include/GL/Regal.h
93 LIB.DEPS += src/regal/RegalPrivate.h
94
95 LIB.OBJS := $(addprefix tmp/$(SYSTEM)/regal/static/,$(LIB.SRCS.NAMES))
96 LIB.OBJS := $(LIB.OBJS:.c=.o)
97 LIB.OBJS := $(LIB.OBJS:.cpp=.o)
98 LIB.SOBJS := $(addprefix tmp/$(SYSTEM)/regal/shared/,$(LIB.SRCS.NAMES))
99 LIB.SOBJS := $(LIB.SOBJS:.c=.o)
100 LIB.SOBJS := $(LIB.SOBJS:.cpp=.o)
101
102 CFLAGS += -DREGAL_NO_HTTP
103
863416d @johnmccutchan Disable building of static lib for NaCL
johnmccutchan authored
104 regal.lib: lib lib/$(LIB.SHARED) glu.lib
8fa358a @johnmccutchan Initial cut of NaCL build configuration
johnmccutchan authored
105
106 lib:
107 mkdir lib
108
109 lib/$(LIB.STATIC): $(LIB.OBJS)
110 $(AR) cr $@ $^
111 ifneq ($(STRIP),)
112 $(STRIP) -x $@
113 endif
114
115 lib/$(LIB.SHARED): $(LIB.SOBJS)
e4655bc @johnmccutchan Make fixes
johnmccutchan authored
116 $(CC) $(LDFLAGS.SO) -o $@ $^ $(LIB.LDFLAGS) $(LIB.LIBS)
8fa358a @johnmccutchan Initial cut of NaCL build configuration
johnmccutchan authored
117 ifneq ($(LN),)
118 $(LN) $(LIB.SHARED) lib/$(LIB.SONAME)
119 $(LN) $(LIB.SHARED) lib/$(LIB.DEVLNK)
120 ifneq ($(LIB.FRAMEWORK),)
121 $(LN) $(LIB.SHARED) lib/$(LIB.FRAMEWORK)
122 endif
123 endif
124 ifneq ($(STRIP),)
125 $(STRIP) -x $@
126 endif
127
128 tmp/$(SYSTEM)/regal/static/%.o: src/regal/%.cpp $(LIB.DEPS)
129 @mkdir -p $(dir $@)
130 $(CC) $(CFLAGS) $(CFLAGS.SO) $(LIB.INCLUDE) -o $@ -c $<
131
132 tmp/$(SYSTEM)/regal/shared/%.o: src/regal/%.cpp $(LIB.DEPS)
133 @mkdir -p $(dir $@)
134 $(CC) $(CFLAGS) $(PICFLAG) $(CFLAGS.SO) $(LIB.INCLUDE) -o $@ -c $<
135
136 tmp/$(SYSTEM)/regal/static/%.o: src/mongoose/%.c $(LIB.DEPS)
137 @mkdir -p $(dir $@)
138 $(CC) $(CFLAGS) $(CFLAGS.SO) $(LIB.INCLUDE) -o $@ -c $<
139
140 tmp/$(SYSTEM)/regal/shared/%.o: src/mongoose/%.c $(LIB.DEPS)
141 @mkdir -p $(dir $@)
142 $(CC) $(CFLAGS) $(PICFLAG) $(CFLAGS.SO) $(LIB.INCLUDE) -o $@ -c $<
143
144 #
145 # RegalGLEW
146 #
147
148 GLEW.SRCS += src/glew/src/glew.c
149 GLEW.SRCS.NAMES := $(notdir $(GLEW.SRCS))
150 GLEW.OBJS := $(addprefix tmp/$(SYSTEM)/glew/shared/,$(GLEW.SRCS.NAMES))
151 GLEW.OBJS := $(GLEW.OBJS:.c=.o)
152 GLEW.CFLAGS := -Isrc/glew/include -Isrc/glu/include -DGLEW_EXPORTS -DGLEW_BUILD -DGLEW_REGAL
153 GLEW.LIBS := -Llib -lRegal
154 GLEW.SHARED := libRegalGLEW.$(EXT.DYNAMIC)
155 GLEW.STATIC := libRegalGLEW.a
156
157 glew.lib: lib lib/$(GLEW.SHARED)
158
159 tmp/$(SYSTEM)/glew/shared/%.o: src/glew/src/%.c
160 @mkdir -p $(dir $@)
161 $(CC) $(CFLAGS) $(PICFLAG) $(GLEW.CFLAGS) $(CFLAGS.SO) -o $@ -c $<
162
163 lib/$(GLEW.SHARED): $(GLEW.OBJS) lib/$(LIB.SHARED)
164 $(LD) $(LDFLAGS.DYNAMIC) -o $@ $^ $(LIB.LDFLAGS) $(GLEW.LIBS) -lpthread
165 ifneq ($(STRIP),)
166 $(STRIP) -x $@
167 endif
168
169 #
170 # RegalGLEW glewinfo
171 #
172
173 GLEWINFO.SRCS += src/glew/src/glewinfo.c
174 GLEWINFO.SRCS.NAMES := $(notdir $(GLEWINFO.SRCS))
175 GLEWINFO.OBJS := $(addprefix tmp/$(SYSTEM)/glewinfo/static/,$(GLEWINFO.SRCS.NAMES))
176 GLEWINFO.OBJS := $(GLEWINFO.OBJS:.c=.o)
177 GLEWINFO.CFLAGS := -Iinclude -Isrc/glew/include -DGLEW_REGAL
178 GLEWINFO.LIBS += -Llib -lRegal -lRegalGLEW $(LDFLAGS.GLUT) $(LDFLAGS.AGL)
179
180 ifneq ($(filter linux%,$(SYSTEM)),)
181 GLEWINFO.LIBS += -lX11
182 endif
183
184 tmp/$(SYSTEM)/glewinfo/static/%.o: src/glew/src/%.c
185 @mkdir -p $(dir $@)
186 $(CC) $(CFLAGS) $(GLEWINFO.CFLAGS) $(CFLAGS.SO) -o $@ -c $<
187
188 bin/glewinfo: $(GLEWINFO.OBJS) lib/$(LIB.SHARED) lib/$(GLEW.SHARED)
189 $(LD) -o $@ $^ $(LIB.LDFLAGS) $(GLEWINFO.LIBS)
190 ifneq ($(STRIP),)
191 $(STRIP) -x $@
192 endif
193
194
195 ifneq ($(filter darwin%,$(SYSTEM)),)
196 glut.lib:
197
198 else
199
200 #
201 # RegalGLUT
202 #
203
204 # NOT for windows...
205
206 GLUT.SRCS += src/glut/src/capturexfont.c
207 GLUT.SRCS += src/glut/src/glut_glxext.c
208 GLUT.SRCS += src/glut/src/glut_menu.c
209 GLUT.SRCS += src/glut/src/glut_menu2.c
210 GLUT.SRCS += src/glut/src/layerutil.c
211
212 # Windows and Linux...
213
214 GLUT.SRCS += src/glut/src/glut_8x13.c
215 GLUT.SRCS += src/glut/src/glut_9x15.c
216 GLUT.SRCS += src/glut/src/glut_bitmap.c
217 GLUT.SRCS += src/glut/src/glut_bwidth.c
218 GLUT.SRCS += src/glut/src/glut_cindex.c
219 GLUT.SRCS += src/glut/src/glut_cmap.c
220 GLUT.SRCS += src/glut/src/glut_cursor.c
221 GLUT.SRCS += src/glut/src/glut_dials.c
222 GLUT.SRCS += src/glut/src/glut_dstr.c
223 GLUT.SRCS += src/glut/src/glut_event.c
224 GLUT.SRCS += src/glut/src/glut_ext.c
225 GLUT.SRCS += src/glut/src/glut_fcb.c
226 GLUT.SRCS += src/glut/src/glut_fullscrn.c
227 GLUT.SRCS += src/glut/src/glut_gamemode.c
228 GLUT.SRCS += src/glut/src/glut_get.c
229 GLUT.SRCS += src/glut/src/glut_hel10.c
230 GLUT.SRCS += src/glut/src/glut_hel12.c
231 GLUT.SRCS += src/glut/src/glut_hel18.c
232 GLUT.SRCS += src/glut/src/glut_init.c
233 GLUT.SRCS += src/glut/src/glut_input.c
234 GLUT.SRCS += src/glut/src/glut_joy.c
235 GLUT.SRCS += src/glut/src/glut_key.c
236 GLUT.SRCS += src/glut/src/glut_keyctrl.c
237 GLUT.SRCS += src/glut/src/glut_keyup.c
238 GLUT.SRCS += src/glut/src/glut_mesa.c
239 GLUT.SRCS += src/glut/src/glut_modifier.c
240 GLUT.SRCS += src/glut/src/glut_mroman.c
241 GLUT.SRCS += src/glut/src/glut_overlay.c
242 GLUT.SRCS += src/glut/src/glut_roman.c
243 GLUT.SRCS += src/glut/src/glut_shapes.c
244 GLUT.SRCS += src/glut/src/glut_space.c
245 GLUT.SRCS += src/glut/src/glut_stroke.c
246 GLUT.SRCS += src/glut/src/glut_swap.c
247 GLUT.SRCS += src/glut/src/glut_swidth.c
248 GLUT.SRCS += src/glut/src/glut_tablet.c
249 GLUT.SRCS += src/glut/src/glut_teapot.c
250 GLUT.SRCS += src/glut/src/glut_tr10.c
251 GLUT.SRCS += src/glut/src/glut_tr24.c
252 GLUT.SRCS += src/glut/src/glut_util.c
253 GLUT.SRCS += src/glut/src/glut_vidresize.c
254 GLUT.SRCS += src/glut/src/glut_warp.c
255 GLUT.SRCS += src/glut/src/glut_win.c
256 GLUT.SRCS += src/glut/src/glut_winmisc.c
257 GLUT.SRCS += src/glut/src/glut_ppm.c
258 GLUT.SRCS.NAMES := $(notdir $(GLUT.SRCS))
259 GLUT.OBJS := $(addprefix tmp/$(SYSTEM)/glut/shared/,$(GLUT.SRCS.NAMES))
260 GLUT.OBJS := $(GLUT.OBJS:.c=.o)
261 GLUT.CFLAGS := -Isrc/glut/include -DBUILD_GLUT32 -DGLUT_BUILDING_LIB -DGLUT_STATIC
262 GLUT.LIBS := -Llib -lRegal
263 GLUT.LIBS += -lGLU -lX11 -lXmu -lXi
264 GLUT.LIBS += -lpthread -lm
265 GLUT.SHARED := libRegalGLUT.$(EXT.DYNAMIC)
266 GLUT.STATIC := libRegalGLUT.a
267
268 glut.lib: lib lib/$(GLUT.SHARED)
269
270 tmp/$(SYSTEM)/glut/shared/%.o: src/glut/src/%.c
271 @mkdir -p $(dir $@)
272 $(CC) $(CFLAGS) $(PICFLAG) $(GLUT.CFLAGS) $(CFLAGS.SO) -o $@ -c $<
273
274 lib/$(GLUT.SHARED): $(GLUT.OBJS) lib/$(LIB.SHARED)
275 $(LD) $(LDFLAGS.DYNAMIC) -o $@ $^ $(GLUT.LIBS)
276 ifneq ($(STRIP),)
277 $(STRIP) -x $@
278 endif
279
280 endif
281
b582bc1 @johnmccutchan Build GLU
johnmccutchan authored
282 #
283 # RegalGLU
284 #
285
286 GLU.SRCS += src/glu/libtess/dict.c
287 GLU.SRCS += src/glu/libtess/geom.c
288 GLU.SRCS += src/glu/libtess/memalloc.c
289 GLU.SRCS += src/glu/libtess/mesh.c
290 GLU.SRCS += src/glu/libtess/normal.c
291 #GLU.SRCS += src/glu/libtess/priorityq-heap.c
292 GLU.SRCS += src/glu/libtess/priorityq.c
293 GLU.SRCS += src/glu/libtess/render.c
294 GLU.SRCS += src/glu/libtess/sweep.c
295 GLU.SRCS += src/glu/libtess/tess.c
296 GLU.SRCS += src/glu/libtess/tessmono.c
297 GLU.SRCS += src/glu/libutil/error.c
298 GLU.SRCS += src/glu/libutil/glue.c
299 GLU.SRCS += src/glu/libutil/mipmap.c
300 GLU.SRCS += src/glu/libutil/project.c
301 GLU.SRCS += src/glu/libutil/quad.c
302 GLU.SRCS += src/glu/libutil/registry.c
303
304 GLU.SRCS += src/glu/libnurbs/interface/bezierEval.cc
305 GLU.SRCS += src/glu/libnurbs/interface/bezierPatch.cc
306 GLU.SRCS += src/glu/libnurbs/interface/bezierPatchMesh.cc
307 GLU.SRCS += src/glu/libnurbs/interface/glcurveval.cc
308 GLU.SRCS += src/glu/libnurbs/interface/glinterface.cc
309 GLU.SRCS += src/glu/libnurbs/interface/glrenderer.cc
310 GLU.SRCS += src/glu/libnurbs/interface/glsurfeval.cc
311 GLU.SRCS += src/glu/libnurbs/interface/incurveeval.cc
312 GLU.SRCS += src/glu/libnurbs/interface/insurfeval.cc
313 GLU.SRCS += src/glu/libnurbs/internals/arc.cc
314 GLU.SRCS += src/glu/libnurbs/internals/arcsorter.cc
315 GLU.SRCS += src/glu/libnurbs/internals/arctess.cc
316 GLU.SRCS += src/glu/libnurbs/internals/backend.cc
317 GLU.SRCS += src/glu/libnurbs/internals/basiccrveval.cc
318 GLU.SRCS += src/glu/libnurbs/internals/basicsurfeval.cc
319 GLU.SRCS += src/glu/libnurbs/internals/bin.cc
320 GLU.SRCS += src/glu/libnurbs/internals/bufpool.cc
321 GLU.SRCS += src/glu/libnurbs/internals/cachingeval.cc
322 GLU.SRCS += src/glu/libnurbs/internals/ccw.cc
323 GLU.SRCS += src/glu/libnurbs/internals/coveandtiler.cc
324 GLU.SRCS += src/glu/libnurbs/internals/curve.cc
325 GLU.SRCS += src/glu/libnurbs/internals/curvelist.cc
326 GLU.SRCS += src/glu/libnurbs/internals/curvesub.cc
327 GLU.SRCS += src/glu/libnurbs/internals/dataTransform.cc
328 GLU.SRCS += src/glu/libnurbs/internals/displaylist.cc
329 GLU.SRCS += src/glu/libnurbs/internals/flist.cc
330 GLU.SRCS += src/glu/libnurbs/internals/flistsorter.cc
331 GLU.SRCS += src/glu/libnurbs/internals/hull.cc
332 GLU.SRCS += src/glu/libnurbs/internals/intersect.cc
333 GLU.SRCS += src/glu/libnurbs/internals/knotvector.cc
334 GLU.SRCS += src/glu/libnurbs/internals/mapdesc.cc
335 GLU.SRCS += src/glu/libnurbs/internals/mapdescv.cc
336 GLU.SRCS += src/glu/libnurbs/internals/maplist.cc
337 GLU.SRCS += src/glu/libnurbs/internals/mesher.cc
338 GLU.SRCS += src/glu/libnurbs/internals/monotonizer.cc
339 GLU.SRCS += src/glu/libnurbs/internals/monoTriangulationBackend.cc
340 GLU.SRCS += src/glu/libnurbs/internals/mycode.cc
341 GLU.SRCS += src/glu/libnurbs/internals/nurbsinterfac.cc
342 GLU.SRCS += src/glu/libnurbs/internals/nurbstess.cc
343 GLU.SRCS += src/glu/libnurbs/internals/patch.cc
344 GLU.SRCS += src/glu/libnurbs/internals/patchlist.cc
345 GLU.SRCS += src/glu/libnurbs/internals/quilt.cc
346 GLU.SRCS += src/glu/libnurbs/internals/reader.cc
347 GLU.SRCS += src/glu/libnurbs/internals/renderhints.cc
348 GLU.SRCS += src/glu/libnurbs/internals/slicer.cc
349 GLU.SRCS += src/glu/libnurbs/internals/sorter.cc
350 GLU.SRCS += src/glu/libnurbs/internals/splitarcs.cc
351 GLU.SRCS += src/glu/libnurbs/internals/subdivider.cc
352 GLU.SRCS += src/glu/libnurbs/internals/tobezier.cc
353 GLU.SRCS += src/glu/libnurbs/internals/trimline.cc
354 GLU.SRCS += src/glu/libnurbs/internals/trimregion.cc
355 GLU.SRCS += src/glu/libnurbs/internals/trimvertpool.cc
356 GLU.SRCS += src/glu/libnurbs/internals/uarray.cc
357 GLU.SRCS += src/glu/libnurbs/internals/varray.cc
358 GLU.SRCS += src/glu/libnurbs/nurbtess/directedLine.cc
359 GLU.SRCS += src/glu/libnurbs/nurbtess/gridWrap.cc
360 GLU.SRCS += src/glu/libnurbs/nurbtess/monoChain.cc
361 GLU.SRCS += src/glu/libnurbs/nurbtess/monoPolyPart.cc
362 GLU.SRCS += src/glu/libnurbs/nurbtess/monoTriangulation.cc
363 GLU.SRCS += src/glu/libnurbs/nurbtess/partitionX.cc
364 GLU.SRCS += src/glu/libnurbs/nurbtess/partitionY.cc
365 GLU.SRCS += src/glu/libnurbs/nurbtess/polyDBG.cc
366 GLU.SRCS += src/glu/libnurbs/nurbtess/polyUtil.cc
367 GLU.SRCS += src/glu/libnurbs/nurbtess/primitiveStream.cc
368 GLU.SRCS += src/glu/libnurbs/nurbtess/quicksort.cc
369 GLU.SRCS += src/glu/libnurbs/nurbtess/rectBlock.cc
370 GLU.SRCS += src/glu/libnurbs/nurbtess/sampleComp.cc
371 GLU.SRCS += src/glu/libnurbs/nurbtess/sampleCompBot.cc
372 GLU.SRCS += src/glu/libnurbs/nurbtess/sampleCompRight.cc
373 GLU.SRCS += src/glu/libnurbs/nurbtess/sampleCompTop.cc
374 GLU.SRCS += src/glu/libnurbs/nurbtess/sampledLine.cc
375 GLU.SRCS += src/glu/libnurbs/nurbtess/sampleMonoPoly.cc
376 GLU.SRCS += src/glu/libnurbs/nurbtess/searchTree.cc
377
378 GLU.SRCS.NAMES := $(notdir $(GLU.SRCS))
379 GLU.OBJS := $(addprefix tmp/$(SYSTEM)/glu/shared/,$(GLU.SRCS.NAMES))
380 GLU.OBJS := $(GLU.OBJS:.c=.o) $(GLU.OBJS:.cc=.o)
381 GLU.OBJS := $(filter %.o,$(GLU.OBJS))
382 GLU.CFLAGS := -Isrc/glu/include -Isrc/glu/libnurbs/interface -Isrc/glu/libnurbs/internals -Isrc/glu/libnurbs/nurbtess
383 GLU.CFLAGS += -DLIBRARYBUILD
384 GLU.LIBS := -Llib
385 GLU.LIBS += -lpthread -lm
386 GLU.SHARED := libRegalGLU.so
387 GLU.STATIC := libRegalGLU.a
388
389 glu.lib: lib lib/$(GLU.SHARED)
390
391 tmp/$(SYSTEM)/glu/shared/%.o: src/glu/libtess/%.c
392 @mkdir -p $(dir $@)
393 $(CCACHE) $(CC) $(CFLAGS) $(PICFLAG) $(GLU.CFLAGS) $(CFLAGS.SO) -o $@ -c $<
394
395 tmp/$(SYSTEM)/glu/shared/%.o: src/glu/libutil/%.c
396 @mkdir -p $(dir $@)
397 $(CCACHE) $(CC) $(CFLAGS) $(PICFLAG) $(GLU.CFLAGS) $(CFLAGS.SO) -o $@ -c $<
398
399 tmp/$(SYSTEM)/glu/shared/%.o: src/glu/libnurbs/interface/%.cc
400 @mkdir -p $(dir $@)
401 $(CCACHE) $(CC) $(CFLAGS) $(PICFLAG) $(GLU.CFLAGS) $(CFLAGS.SO) -o $@ -c $<
402
403 tmp/$(SYSTEM)/glu/shared/%.o: src/glu/libnurbs/internals/%.cc
404 @mkdir -p $(dir $@)
405 $(CCACHE) $(CC) $(CFLAGS) $(PICFLAG) $(GLU.CFLAGS) $(CFLAGS.SO) -o $@ -c $<
406
407 tmp/$(SYSTEM)/glu/shared/%.o: src/glu/libnurbs/nurbtess/%.cc
408 @mkdir -p $(dir $@)
409 $(CCACHE) $(CC) $(CFLAGS) $(PICFLAG) $(GLU.CFLAGS) $(CFLAGS.SO) -o $@ -c $<
410
411 lib/$(GLU.SHARED): $(GLU.OBJS)
412 $(CCACHE) $(CC) $(LDFLAGS.SO) $(LDFLAGS.EXTRA) $(LDFLAGS.DYNAMIC) -o $@ $^
413 ifneq ($(STRIP),)
414 $(STRIP) -x $@
415 endif
416
8fa358a @johnmccutchan Initial cut of NaCL build configuration
johnmccutchan authored
417 # Examples
418
b3f40a3 @johnmccutchan Build fixes
johnmccutchan authored
419 regal.bin: lib bin bin/nacl$(BIN_EXTENSION)
8fa358a @johnmccutchan Initial cut of NaCL build configuration
johnmccutchan authored
420
421 bin:
422 mkdir bin
423
424 #
425 # dreamtorus
426 #
427
428 DREAMTORUS.SRCS += examples/dreamtorus/src/render.cpp
429 DREAMTORUS.SRCS += examples/dreamtorus/glut/code/main.cpp
430 DREAMTORUS.SRCS.NAMES := $(notdir $(DREAMTORUS.SRCS))
431 DREAMTORUS.OBJS := $(addprefix tmp/$(SYSTEM)/dreamtorus/static/,$(DREAMTORUS.SRCS.NAMES))
432 DREAMTORUS.OBJS := $(DREAMTORUS.OBJS:.cpp=.o)
433 DREAMTORUS.CFLAGS := -Iinclude -Iexamples/dreamtorus/src
434 DREAMTORUS.LIBS += -Llib -lRegal $(LDFLAGS.GLUT)
435 DREAMTORUS.LIBS += -lm -lpthread
436
437 tmp/$(SYSTEM)/dreamtorus/static/%.o: examples/dreamtorus/src/%.cpp
438 @mkdir -p $(dir $@)
439 $(CC) $(CFLAGS) $(DREAMTORUS.CFLAGS) $(CFLAGS.SO) -o $@ -c $<
440
441 tmp/$(SYSTEM)/dreamtorus/static/%.o: examples/dreamtorus/glut/code/%.cpp
442 @mkdir -p $(dir $@)
443 $(CC) $(CFLAGS) $(DREAMTORUS.CFLAGS) $(CFLAGS.SO) -o $@ -c $<
444
445 bin/dreamtorus: $(DREAMTORUS.OBJS) lib/$(LIB.SHARED)
446 $(LD) -o $@ $^ $(LIB.LDFLAGS) $(DREAMTORUS.LIBS)
447 ifneq ($(STRIP),)
448 $(STRIP) -x $@
449 endif
450
451 #
452 # tiger
453 #
454
455 TIGER.SRCS += examples/tiger/nvpr_tiger.c
456 TIGER.SRCS += examples/tiger/tiger.c
457 TIGER.SRCS += examples/tiger/xform.c
458 TIGER.SRCS.NAMES := $(notdir $(TIGER.SRCS))
459 TIGER.OBJS := $(addprefix tmp/$(SYSTEM)/tiger/static/,$(TIGER.SRCS.NAMES))
460 TIGER.OBJS := $(TIGER.OBJS:.c=.o)
461 TIGER.CFLAGS := -Iinclude
462 TIGER.LIBS += -Llib -lRegalGLEW $(LDFLAGS.GLUT) -lRegal
463 TIGER.LIBS += -lm -lpthread
464
465 tmp/$(SYSTEM)/tiger/static/%.o: examples/tiger/%.c
466 @mkdir -p $(dir $@)
467 $(CC) $(CFLAGS) $(TIGER.CFLAGS) $(CFLAGS.SO) -o $@ -c $<
468
469 bin/tiger: $(TIGER.OBJS) lib/$(GLEW.SHARED) lib/$(LIB.SHARED)
470 $(LD) -o $@ $^ $(TIGER.LIBS)
471 ifneq ($(STRIP),)
472 $(STRIP) -x $@
473 endif
474
475 NACLHELLOWORLD.SRCS += examples/nacl/main.cpp
476 NACLHELLOWORLD.SRCS.NAMES := $(notdir $(NACLHELLOWORLD.SRCS))
477 NACLHELLOWORLD.OBJS := $(addprefix tmp/$(SYSTEM)/nacl/static/,$(NACLHELLOWORLD.SRCS.NAMES))
478 NACLHELLOWORLD.OBJS := $(NACLHELLOWORLD.OBJS:.cpp=.o)
479 NACLHELLOWORLD.CFLAGS := -Iinclude
b582bc1 @johnmccutchan Build GLU
johnmccutchan authored
480 NACLHELLOWORLD.LIBS += -L./lib -lRegal -lRegalGLU
e4655bc @johnmccutchan Make fixes
johnmccutchan authored
481 NACLHELLOWORLD.LIBS += -lm -lpthread -lppapi -lppapi_gles2
8fa358a @johnmccutchan Initial cut of NaCL build configuration
johnmccutchan authored
482
483 tmp/$(SYSTEM)/nacl/static/%.o: examples/nacl/%.cpp
484 @mkdir -p $(dir $@)
485 $(CC) $(CFLAGS) $(NACLHELLOWORLD.CFLAGS) $(CFLAGS.SO) -o $@ -c $<
486
e4655bc @johnmccutchan Make fixes
johnmccutchan authored
487 bin/nacl$(BIN_EXTENSION): $(NACLHELLOWORLD.OBJS)
488 $(CC) -o $@ $^ $(NACLHELLOWORLD.LIBS)
8fa358a @johnmccutchan Initial cut of NaCL build configuration
johnmccutchan authored
489 ifneq ($(STRIP),)
490 $(STRIP) -x $@
491 endif
492
493 #
494 # GLUT dependency for non-Mac builds
495 #
496
497 ifeq ($(filter darwin%,$(SYSTEM)),)
498 bin/tiger: lib/$(GLUT.SHARED)
499 bin/dreamtorus: lib/$(GLUT.SHARED)
500 endif
501
502 clean:
503 $(RM) -r tmp/
504 $(RM) -r lib/
e4655bc @johnmccutchan Make fixes
johnmccutchan authored
505 $(RM) -f bin/nacl$(BIN_EXTENSION)
8fa358a @johnmccutchan Initial cut of NaCL build configuration
johnmccutchan authored
506 $(RM) glew.pc glewmx.pc
507
508
509 .PHONY: export
510 .PHONY: regal.lib regal.bin all debug
511 .PHONY: clean distclean tardist dist-win32 dist-src
Something went wrong with that request. Please try again.