~diresu/blender/blender-command-port

« back to all changes in this revision

Viewing changes to source/Makefile

  • Committer: theeth
  • Date: 2008-10-14 16:52:04 UTC
  • Revision ID: vcs-imports@canonical.com-20081014165204-r32w2gm6s0osvdhn
copy back trunk

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#
 
2
# $Id: Makefile 16512 2008-09-14 03:51:51Z blendix $
 
3
#
 
4
# ***** BEGIN GPL LICENSE BLOCK *****
 
5
#
 
6
# This program is free software; you can redistribute it and/or
 
7
# modify it under the terms of the GNU General Public License
 
8
# as published by the Free Software Foundation; either version 2
 
9
# of the License, or (at your option) any later version.
 
10
#
 
11
# This program is distributed in the hope that it will be useful,
 
12
# but WITHOUT ANY WARRANTY; without even the implied warranty of
 
13
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
14
# GNU General Public License for more details.
 
15
#
 
16
# You should have received a copy of the GNU General Public License
 
17
# along with this program; if not, write to the Free Software Foundation,
 
18
# Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 
19
#
 
20
# The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
 
21
# All rights reserved.
 
22
#
 
23
# The Original Code is: all of this file.
 
24
#
 
25
# Contributor(s): none yet.
 
26
#
 
27
# ***** END GPL LICENSE BLOCK *****
 
28
#
 
29
# Top level makefile. Start looping through subdirs and link....
 
30
#
 
31
 
 
32
ifndef NANENV
 
33
    export NANENV := $(shell env | grep NAN_)
 
34
endif
 
35
 
 
36
include nan_definitions.mk
 
37
 
 
38
DIRS = creator blender kernel
 
39
 
 
40
ifneq ($(NAN_NO_KETSJI),true)
 
41
   DIRS += gameengine
 
42
endif
 
43
 
 
44
ifeq ($(OS),windows)
 
45
    DIRS += icons
 
46
endif
 
47
 
 
48
########## buildinfo kludge ###################
 
49
CPPFLAGS += -I../Physics/common
 
50
CPPFLAGS += -I../Physics/Dummy
 
51
ifdef NAN_BUILDINFO
 
52
    BUILDINFO_O = $(DIR)/$(DEBUG_DIR)buildinfo.o
 
53
    BUILDINFO_C = $(SRCHOME)/creator/buildinfo.c
 
54
    BUILD_DATE := $(shell date "+%Y-%m-%d")
 
55
    BUILD_TIME := $(shell date "+%H:%M:%S")
 
56
        BUILD_REV := $(shell svnversion)
 
57
endif
 
58
 
 
59
############# set pyplayerlib ##################
 
60
 
 
61
 
 
62
############# libraries ##################
 
63
# COMLIB COMmon LIBraries for all targets
 
64
# BPLIB Browser Plugin LIBraries
 
65
# SPLIB1 Standalone Player LIBraries (pre COMLIB)
 
66
# SPLIB Standalone Player LIBraries (post COMLIB)
 
67
# PULIB PUblisher LIBraries
 
68
# GRPLIB Gui and Render LIBraries for Publisher
 
69
# LLIBS dynamic system libraries
 
70
# SADD Static OpenGL libraries
 
71
# DADD Dynamic OpenGL libraries
 
72
# NSPLUGLIB PLUGin LIBraries for ns-style api
 
73
# PLUGAPPLIB libs that form the application to be plugged in
 
74
# Note: the order is important here
 
75
 
 
76
GRPLIB = $(OCGDIR)/creator/$(DEBUG_DIR)libcreator.a
 
77
GRPLIB += $(OCGDIR)/blender/src/$(DEBUG_DIR)libsrcpublisher.a
 
78
GRPLIB += $(NAN_BSP)/lib/$(DEBUG_DIR)libbsp.a
 
79
GRPLIB += $(NAN_BOOLOP)/lib/$(DEBUG_DIR)libboolop.a
 
80
GRPLIB += $(NAN_SOUNDSYSTEM)/lib/$(DEBUG_DIR)libSoundSystem.a
 
81
GRPLIB += $(NAN_GHOST)/lib/$(DEBUG_DIR)libghost.a
 
82
GRPLIB += $(NAN_STRING)/lib/$(DEBUG_DIR)libstring.a
 
83
GRPLIB += $(OCGDIR)/blender/render/$(DEBUG_DIR)librender.a
 
84
GRPLIB += $(OCGDIR)/blender/radiosity/$(DEBUG_DIR)libradiosity.a
 
85
GRPLIB += $(NAN_OPENNL)/lib/$(DEBUG_DIR)libopennl.a
 
86
GRPLIB += $(NAN_SUPERLU)/lib/$(DEBUG_DIR)libsuperlu.a   
 
87
GRPLIB += $(OCGDIR)/blender/python/$(DEBUG_DIR)libpython.a
 
88
 
 
89
# nlin: the reason that some libraries appear more than once below is
 
90
# to handle circular dependencies in linking among libraries... some
 
91
# linkers (e.g. under Linux) need libs to be specified multiple times
 
92
# to properly resolve circular dependencies. ugly, but it works...
 
93
# the repeat entries could probably be trimmed down.
 
94
COMLIB = $(OCGDIR)/blender/blenkernel/$(DEBUG_DIR)libblenkernel.a
 
95
COMLIB += $(NAN_DECIMATION)/lib/libdecimation.a
 
96
COMLIB += $(OCGDIR)/blender/blenloader/$(DEBUG_DIR)libblenloader.a
 
97
COMLIB += $(OCGDIR)/blender/blenpluginapi/$(DEBUG_DIR)libblenpluginapi.a
 
98
COMLIB += $(OCGDIR)/blender/nodes_shd/$(DEBUG_DIR)libnodes_shd.a
 
99
COMLIB += $(OCGDIR)/blender/nodes_cmp/$(DEBUG_DIR)libnodes_cmp.a
 
100
COMLIB += $(OCGDIR)/blender/nodes/$(DEBUG_DIR)libnodes.a
 
101
COMLIB += $(OCGDIR)/blender/imbuf/$(DEBUG_DIR)libimbuf.a
 
102
COMLIB += $(OCGDIR)/blender/blenlib/$(DEBUG_DIR)libblenlib.a
 
103
COMLIB += $(NAN_IKSOLVER)/lib/libiksolver.a
 
104
COMLIB += $(NAN_OPENNL)/lib/$(DEBUG_DIR)libopennl.a
 
105
COMLIB += $(NAN_SUPERLU)/lib/$(DEBUG_DIR)libsuperlu.a   
 
106
COMLIB += $(OCGDIR)/blender/avi/$(DEBUG_DIR)libavi.a
 
107
COMLIB += $(NAN_JPEG)/lib/libjpeg.a
 
108
COMLIB += $(OCGDIR)/blender/gpu/$(DEBUG_DIR)libgpu.a
 
109
COMLIB += $(NAN_GLEW)/lib/libglew.a
 
110
 
 
111
ifneq ($(NAN_NO_KETSJI),true)
 
112
    COMLIB += $(OCGDIR)/gameengine/bloutines/$(DEBUG_DIR)libbloutines.a
 
113
    COMLIB += $(OCGDIR)/gameengine/blconverter/$(DEBUG_DIR)libblconverter.a
 
114
    COMLIB += $(OCGDIR)/gameengine/blphys/common/$(DEBUG_DIR)libcommon.a
 
115
    COMLIB += $(OCGDIR)/gameengine/ketsji/$(DEBUG_DIR)libketsji.a
 
116
    COMLIB += $(OCGDIR)/gameengine/blconverter/$(DEBUG_DIR)libblconverter.a
 
117
    COMLIB += $(OCGDIR)/gameengine/blconverter/$(DEBUG_DIR)libblconverter.a
 
118
    COMLIB += $(NAN_SOLID)/lib/libsolid.a
 
119
    COMLIB += $(NAN_SOLID)/lib/libsolid_broad.a 
 
120
    COMLIB += $(NAN_SOLID)/lib/libsolid_complex.a
 
121
    COMLIB += $(NAN_SOLID)/lib/libsolid_convex.a
 
122
    COMLIB += $(OCGDIR)/gameengine/blphys/sumo/$(DEBUG_DIR)libsumo.a
 
123
    COMLIB += $(OCGDIR)/gameengine/blphys/fuzzics/$(DEBUG_DIR)libfuzzics.a
 
124
    COMLIB += $(NAN_QHULL)/lib/libqhull.a
 
125
    COMLIB += $(OCGDIR)/gameengine/blphys/dummy/$(DEBUG_DIR)libdummy.a
 
126
    COMLIB += $(OCGDIR)/gameengine/blphys/common/$(DEBUG_DIR)libcommon.a
 
127
#    COMLIB += $(OCGDIR)/gameengine/blphys/sumo/$(DEBUG_DIR)libsumo.a
 
128
    COMLIB += $(OCGDIR)/gameengine/blphys/dummy/$(DEBUG_DIR)libdummy.a
 
129
    COMLIB += $(OCGDIR)/gameengine/ketsji/$(DEBUG_DIR)libketsji.a
 
130
    COMLIB += $(OCGDIR)/gameengine/blphys/common/$(DEBUG_DIR)libcommon.a
 
131
#    COMLIB += $(OCGDIR)/gameengine/blphys/blode/$(DEBUG_DIR)libblode.a
 
132
#    COMLIB += $(OCGDIR)/gameengine/blphys/sumo/$(DEBUG_DIR)libsumo.a
 
133
    COMLIB += $(OCGDIR)/gameengine/blphys/dummy/$(DEBUG_DIR)libdummy.a
 
134
    COMLIB += $(OCGDIR)/gameengine/blphys/blbullet/$(DEBUG_DIR)libblbullet.a
 
135
    COMLIB += $(OCGDIR)/gameengine/blphys/common/$(DEBUG_DIR)libcommon.a
 
136
#    COMLIB += $(OCGDIR)/gameengine/blphys/sumo/$(DEBUG_DIR)libsumo.a
 
137
    COMLIB += $(OCGDIR)/gameengine/blphys/dummy/$(DEBUG_DIR)libdummy.a
 
138
    COMLIB += $(OCGDIR)/gameengine/ketsji/$(DEBUG_DIR)libketsji.a
 
139
    COMLIB += $(OCGDIR)/gameengine/logic/$(DEBUG_DIR)liblogic.a
 
140
    COMLIB += $(OCGDIR)/gameengine/logic/Joystick/$(DEBUG_DIR)libJoystick.a
 
141
    COMLIB += $(OCGDIR)/gameengine/rasterizer/$(DEBUG_DIR)librasterizer.a
 
142
    COMLIB += $(OCGDIR)/gameengine/OpenGLrasterizer/$(DEBUG_DIR)libOpenGLrasterizer.a
 
143
    COMLIB += $(OCGDIR)/gameengine/expression/$(DEBUG_DIR)libexpression.a
 
144
    COMLIB += $(OCGDIR)/gameengine/scenegraph/$(DEBUG_DIR)libscenegraph.a
 
145
#    COMLIB += $(OCGDIR)/sumo/$(DEBUG_DIR)libfuzzics.a
 
146
#    COMLIB += $(OCGDIR)/sumo/$(DEBUG_DIR)libsolid.a
 
147
    COMLIB += $(NAN_MOTO)/lib/libmoto.a
 
148
    COMLIB += $(NAN_SND_LIBS)
 
149
    COMLIB += $(OCGDIR)/kernel/gen_system/$(DEBUG_DIR)libgen_system.a
 
150
    COMLIB += $(OCGDIR)/kernel/gen_messaging/$(DEBUG_DIR)libgen_messaging.a
 
151
    COMLIB += $(OCGDIR)/gameengine/ketsji/KXNetwork/$(DEBUG_DIR)libKXNetwork.a
 
152
    COMLIB += $(OCGDIR)/gameengine/Network/$(DEBUG_DIR)libNetwork.a
 
153
    COMLIB += $(OCGDIR)/gameengine/Network/LoopBackNetwork/$(DEBUG_DIR)libLoopBackNetwork.a
 
154
    COMLIB += $(NAN_BULLET2)/lib/libbullet2.a
 
155
endif
 
156
 
 
157
COMLIB += $(NAN_GUARDEDALLOC)/lib/libguardedalloc.a
 
158
COMLIB += $(NAN_MEMUTIL)/lib/libmemutil.a
 
159
COMLIB += $(NAN_BMFONT)/lib/$(DEBUG_DIR)libbmfont.a
 
160
COMLIB += $(NAN_PNG)/lib/libpng.a
 
161
COMLIB += $(OCGDIR)/blender/yafray/$(DEBUG_DIR)libyafrayexport.a
 
162
COMLIB += $(OCGDIR)/blender/blenlib/$(DEBUG_DIR)libblenlib.a
 
163
 
 
164
ifeq ($(WITH_QUICKTIME), true)
 
165
    COMLIB += $(OCGDIR)/blender/blenderqt/$(DEBUG_DIR)libblenderqt.a
 
166
endif
 
167
 
 
168
ifeq ($(WITH_OPENEXR), true)
 
169
    COMLIB += $(OCGDIR)/blender/imbuf/openexr/$(DEBUG_DIR)libopenexr.a
 
170
endif
 
171
 
 
172
COMLIB += $(OCGDIR)/blender/imbuf/cineon/$(DEBUG_DIR)libcineon.a
 
173
 
 
174
ifeq ($(WITH_DDS), true)
 
175
    COMLIB += $(OCGDIR)/blender/imbuf/dds/$(DEBUG_DIR)libdds.a
 
176
endif
 
177
 
 
178
ifeq ($(WITH_BINRELOC), true)
 
179
    COMLIB += $(OCGDIR)/extern/binreloc/$(DEBUG_DIR)libbinreloc.a
 
180
endif
 
181
 
 
182
ifeq ($(WITH_FREETYPE2), true)
 
183
    COMLIB += $(OCGDIR)/blender/ftfont/$(DEBUG_DIR)libftfont.a
 
184
    ifeq ($(OS), windows)
 
185
      ifeq ($(FREE_WINDOWS), true)
 
186
        COMLIB += $(NAN_FTGL)/lib/libftgl.a
 
187
        COMLIB += $(NAN_FREETYPE)/lib/libfreetype.a
 
188
      else
 
189
        COMLIB += $(NAN_FTGL)/lib/ftgl_static_ST.lib
 
190
        COMLIB += $(NAN_FREETYPE)/lib/freetype2ST.lib
 
191
      endif
 
192
    else
 
193
      COMLIB += $(NAN_FTGL)/lib/libftgl.a
 
194
      ifeq ($(OS), irix)
 
195
        COMLIB += $(NAN_FREETYPE)/lib32/libfreetype.a
 
196
        else
 
197
            COMLIB += $(NAN_FREETYPE)/lib/libfreetype.a
 
198
      endif
 
199
    endif
 
200
endif
 
201
 
 
202
ifeq ($(WITH_VERSE), true)
 
203
   ifeq ($(OS), windows)
 
204
       ifeq ($(FREE_WINDOWS), true)
 
205
           COMLIB += $(NAN_VERSE)/lib/libverse.a
 
206
       else
 
207
           COMLIB += $(NAN_VERSE)/lib/verse.lib
 
208
       endif
 
209
   else
 
210
       COMLIB += $(NAN_VERSE)/lib/libverse.a
 
211
   endif
 
212
endif
 
213
 
 
214
ifeq ($(OS), irix)
 
215
    COMLIB += $(NAN_SDL)/lib/libSDL.a
 
216
endif
 
217
 
 
218
ifeq ($(OS), windows)
 
219
    ifeq ($(FREE_WINDOWS), true)
 
220
        COMLIB += $(NAN_SDL)/lib/libSDL.a
 
221
        COMLIB += $(NAN_PTHREADS)/lib/libpthreadGC2.a
 
222
    else
 
223
        COMLIB += $(NAN_SDL)/lib/SDL.lib
 
224
    endif
 
225
endif
 
226
 
 
227
ifeq ($(WITH_OPENEXR), true)
 
228
    COMLIB += $(NAN_OPENEXR_LIBS)
 
229
endif
 
230
 
 
231
PULIB = $(NAN_MOTO)/lib/libmoto.a
 
232
PULIB += $(NAN_ELBEEM)/lib/$(DEBUG_DIR)libelbeem.a
 
233
PULIB += $(OCGDIR)/blender/readblenfile/$(DEBUG_DIR)libreadblenfile.a
 
234
PULIB += $(OCGDIR)/blender/src/$(DEBUG_DIR)libsrcpublisher.a
 
235
 
 
236
ifeq ($(NAN_NO_KETSJI),true)
 
237
    PULIB += $(NAN_MOTO)/lib/libmoto.a
 
238
    PULIB += $(OCGDIR)/kernel/gen_system/$(DEBUG_DIR)libgen_system.a
 
239
    PULIB += $(OCGDIR)/kernel/gen_messaging/$(DEBUG_DIR)libgen_messaging.a
 
240
    COMLIB += $(NAN_SND_LIBS)
 
241
endif
 
242
 
 
243
SPLIB1 = $(OCGDIR)/gameengine/GamePlayer/ghost/$(DEBUG_DIR)libghost.a
 
244
SPLIB1 += $(OCGDIR)/gameengine/GamePlayer/common/$(DEBUG_DIR)libcommon.a
 
245
SPLIB1 += $(OCGDIR)/gameengine/blconverter/$(DEBUG_DIR)libblconverter.a
 
246
SPLIB1 += $(NAN_STRING)/lib/$(DEBUG_DIR)libstring.a
 
247
SPLIB1 += $(NAN_GHOST)/lib/$(DEBUG_DIR)libghost.a
 
248
 
 
249
SPLIB = $(OCGDIR)/blender/makesdna/$(DEBUG_DIR)DNA.o
 
250
SPLIB += $(OCGDIR)/blender/readblenfile/$(DEBUG_DIR)libreadblenfile.a
 
251
# this is used for the plugin. It uses some things from libz.a, 
 
252
# but somehow it consistently fails to resolve these symbols... or 
 
253
# can I just not check them? nm claims they aren't...
 
254
SPLIB += $(OCGDIR)/blender/blenkernel/blenkernel_blc/$(DEBUG_DIR)libblenkernel_blc.a
 
255
SPLIB += $(OCGDIR)/blender/python/$(DEBUG_DIR)libpython.a
 
256
 
 
257
# These three need to be explicitly mentioned on the cl, because 
 
258
# if they are offered as a lib, they are optimized away. (nzc)
 
259
NSPLUGLIB = $(OCGDIR)/gameengine/GamePlayer/netscape/src/$(DEBUG_DIR)UnixShell.o
 
260
NSPLUGLIB += $(OCGDIR)/gameengine/GamePlayer/netscape/src/$(DEBUG_DIR)stubs.o
 
261
NSPLUGLIB += $(OCGDIR)/gameengine/GamePlayer/netscape/src/$(DEBUG_DIR)winstubs.o
 
262
NSPLUGLIB += $(OCGDIR)/gameengine/GamePlayer/netscape/src/$(DEBUG_DIR)Blender3DPlugin_native_implementation.o
 
263
 
 
264
# Here you can configure what sort of test to make for the plugin.
 
265
#    PLUGTESTLIB = $(OCGDIR)/gameengine/GamePlayer/netscape/test/$(DEBUG_DIR)libns_api_test_stub.a
 
266
#    PLUGTESTLIB = $(OCGDIR)/gameengine/GamePlayer/netscape/test/$(DEBUG_DIR)libns_api_test_colorcycle.a
 
267
#    PLUGTESTLIB = $(OCGDIR)/gameengine/GamePlayer/netscape/test/$(DEBUG_DIR)libns_api_test_gears.a
 
268
PLUGTESTLIB = $(OCGDIR)/gameengine/GamePlayer/netscape/test/$(DEBUG_DIR)libns_api_test_threaded_gears.a
 
269
 
 
270
# XPCOM is done only for Linux for now
 
271
ifeq ($(OS),$(findstring $(OS), "linux"))
 
272
  ifeq ($(CPU),i386)
 
273
    NSPLUGLIB += $(OCGDIR)/gameengine/GamePlayer/netscape/src/$(DEBUG_DIR)XPH_xpcom_hooks.o
 
274
  endif
 
275
endif
 
276
 
 
277
PLUGAPPLIB = $(OCGDIR)/gameengine/GamePlayer/netscape/src/$(DEBUG_DIR)libplugin_ketsji_hooks.a
 
278
 
 
279
ifeq ($(OS),$(findstring $(OS), "freebsd linux irix solaris"))
 
280
    NSPLUGLIB += $(OCGDIR)/gameengine/GamePlayer/netscape/src/$(DEBUG_DIR)PLG_X11_windowing.o
 
281
    PLUGAPPLIB += $(OCGDIR)/gameengine/GamePlayer/common/unix/$(DEBUG_DIR)libunix.a
 
282
endif
 
283
ifeq ($(OS),$(findstring $(OS), "windows"))
 
284
    NSPLUGLIB += $(OCGDIR)/gameengine/GamePlayer/netscape/src/$(DEBUG_DIR)PLG_MSWindows_windowing.o
 
285
    NSPLUGLIB += $(OCGDIR)/gameengine/GamePlayer/netscape/src/$(DEBUG_DIR)npB3DPlg.res
 
286
    PLUGAPPLIB += $(OCGDIR)/gameengine/GamePlayer/common/windows/$(DEBUG_DIR)libwindows.a
 
287
endif
 
288
 
 
289
PLUGAPPLIB += $(OCGDIR)/gameengine/GamePlayer/common/$(DEBUG_DIR)libcommon.a
 
290
 
 
291
ifeq ($(OS),$(findstring $(OS), "linux"))
 
292
  ifeq ($(CPU),i386)
 
293
    PLUGAPPLIB_XPLINK = $(OCGDIR)/gameengine/GamePlayer/netscape/src/$(DEBUG_DIR)_Blender3DPlugin_implementation_.o 
 
294
  endif
 
295
endif
 
296
 
 
297
# A bit silly... but needed to resolve symbols.
 
298
PLUGREMLIB = $(NAN_STRING)/lib/$(DEBUG_DIR)libstring.a
 
299
 
 
300
######################## OS dependencies (alphabetic!) ################
 
301
 
 
302
include nan_link.mk
 
303
 
 
304
ifeq ($(NAN_JUST_BLENDERDYNAMIC),true)
 
305
    BINTARGETS = blenderdynamic
 
306
endif
 
307
 
 
308
ifeq ($(WITH_BF_DYNAMICOPENGL), true)
 
309
    BINTARGETS += blenderdynamic
 
310
endif
 
311
 
 
312
ifeq ($(WITH_BF_STATICOPENGL), true)
 
313
    BINTARGETS += blenderstatic
 
314
endif
 
315
 
 
316
ifeq ($(WITH_BF_BLENDERPLAYER), true)
 
317
    export WITH_BF_GAMEENGINE=true
 
318
    BINTARGETS += blenderplayer
 
319
endif
 
320
 
 
321
ifeq ($(WITH_BF_WEBPLUGIN), true)
 
322
    BINTARGETS += plugin
 
323
    ifeq ($(OS),linux)
 
324
        ifeq ($(CPU),i386)
 
325
             BINTARGETS += xplink
 
326
        endif
 
327
    endif
 
328
endif
 
329
 
 
330
ifeq ($(OS),solaris)
 
331
    PULIB += $(NAN_ZLIB)/lib/libz.a
 
332
    SPLIB += $(NAN_ZLIB)/lib/libz.a
 
333
endif
 
334
 
 
335
# OpenAL libs are already compiled as shared code! Check FMod if we switch to that. (nzc)
 
336
 
 
337
# Some vars to keep the rest of this section mostly readable
 
338
# in an 80 char term
 
339
SOUNDSYSTEM = $(OCGDIR)/intern/SoundSystem/$(DEBUG_DIR)libSoundSystem.a
 
340
DUMMYSOUND  = $(OCGDIR)/intern/DummySoundSystem/$(DEBUG_DIR)libDummySoundSystem.a
 
341
OPENALSOUND = $(OCGDIR)/intern/OpenALSoundSystem/$(DEBUG_DIR)libOpenALSoundSystem.a
 
342
SDLSOUND    = $(OCGDIR)/intern/SDLSoundSystem/$(DEBUG_DIR)libSDLSoundSystem.a
 
343
 
 
344
# Some kooky logic going on here ...
 
345
ifeq ($(NAN_NO_OPENAL), true)
 
346
    NAN_SND_LIBS =  $(SOUNDSYSTEM)
 
347
    NAN_SND_LIBS += $(DUMMYSOUND)
 
348
    NAN_SND_LIBS += $(SOUNDSYSTEM)
 
349
else
 
350
  ifeq ($(OS),$(findstring $(OS), "freebsd linux windows"))
 
351
    ifeq ($(CPU),$(findstring $(CPU), "i386 powerpc x86_64 parisc64"))
 
352
        NAN_SND_LIBS =  $(SOUNDSYSTEM)
 
353
        NAN_SND_LIBS += $(DUMMYSOUND)
 
354
        NAN_SND_LIBS += $(OPENALSOUND)
 
355
        NAN_SND_LIBS += $(SDLSOUND)
 
356
        NAN_SND_LIBS += $(NAN_OPENAL)/lib/libopenal.a
 
357
        ALUT = $(wildcard $(NAN_OPENAL)/lib/libalut.a)
 
358
        NAN_SND_LIBS += $(ALUT)
 
359
        NAN_SND_LIBS += $(SOUNDSYSTEM)
 
360
    else
 
361
      ifeq ($(OS),windows)
 
362
        NAN_SND_LIBS =  $(SOUNDSYSTEM)
 
363
        NAN_SND_LIBS += $(DUMMYSOUND)
 
364
        NAN_SND_LIBS += $(OPENALSOUND)
 
365
        NAN_SND_LIBS += $(SDLSOUND)
 
366
        NAN_SND_LIBS += $(NAN_OPENAL)/lib/openal_static.lib
 
367
        ALUT = $(wildcard $(NAN_OPENAL)/lib/alut_static.lib)
 
368
        NAN_SND_LIBS += $(ALUT)
 
369
        NAN_SND_LIBS += $(SOUNDSYSTEM)
 
370
      else
 
371
        NAN_SND_LIBS =  $(SOUNDSYSTEM)
 
372
        NAN_SND_LIBS += $(DUMMYSOUND)
 
373
        NAN_SND_LIBS += $(SOUNDSYSTEM)
 
374
      endif
 
375
    endif
 
376
  else
 
377
    ifeq ($(OS),darwin)
 
378
      NAN_SND_LIBS =  $(SOUNDSYSTEM)
 
379
      NAN_SND_LIBS += $(DUMMYSOUND)
 
380
      NAN_SND_LIBS += $(OPENALSOUND)
 
381
      NAN_SND_LIBS += $(NAN_OPENAL)/lib/libopenal.a
 
382
      ALUT = $(wildcard $(NAN_OPENAL)/lib/libalut.a)
 
383
      NAN_SND_LIBS += $(ALUT)
 
384
      NAN_SND_LIBS += $(SOUNDSYSTEM)
 
385
    else
 
386
      ifeq ($(OS), solaris)
 
387
        NAN_SND_LIBS =  $(SOUNDSYSTEM)
 
388
        NAN_SND_LIBS += $(DUMMYSOUND)
 
389
        NAN_SND_LIBS += $(OPENALSOUND)
 
390
        NAN_SND_LIBS += $(SDLSOUND)
 
391
        NAN_SND_LIBS += $(NAN_OPENAL)/lib/libopenal.a
 
392
        ALUT = $(wildcard $(NAN_OPENAL)/lib/libalut.a)
 
393
        NAN_SND_LIBS += $(ALUT)
 
394
        NAN_SND_LIBS += $(SOUNDSYSTEM)
 
395
      else
 
396
        NAN_SND_LIBS =  $(SOUNDSYSTEM)
 
397
        NAN_SND_LIBS += $(DUMMYSOUND)
 
398
        NAN_SND_LIBS += $(SOUNDSYSTEM)
 
399
      endif
 
400
    endif
 
401
  endif
 
402
endif
 
403
 
 
404
ifeq ($(OS),windows)
 
405
 
 
406
    # Might need to change this to $(NAN_MOZILLA_LIB)/nspr4.lib
 
407
    NSPLUGLIB += $(NAN_NSPR)/lib/nspr4.lib
 
408
 
 
409
    BINTARGETS = blenderdynamic
 
410
    ifeq ($(FREE_WINDOWS),true)
 
411
        ifneq ($(NAN_NO_KETSJI),true)
 
412
            BINTARGETS += blenderplayer
 
413
        endif
 
414
    else
 
415
        BINTARGETS += blenderplayer
 
416
        BINTARGETS += blenderdynplayer
 
417
        BINTARGETS += plugin
 
418
    endif
 
419
 
 
420
    PULIB += $(OCGDIR)/blender/icons/$(DEBUG_DIR)winblender.res
 
421
    PULIB += $(NAN_ZLIB)/lib/libz.a
 
422
    SPLIB += $(OCGDIR)/blender/icons/$(DEBUG_DIR)winblender.res
 
423
    SPLIB += $(NAN_ZLIB)/lib/libz.a
 
424
endif
 
425
 
 
426
 
 
427
# prepare for NAN_BUILDINFO compile at the *sigh* link rules below
 
428
 
 
429
ifdef NAN_BUILDINFO
 
430
    CSRCS =
 
431
    ALLTARGETS =
 
432
    include nan_compile.mk
 
433
endif
 
434
 
 
435
################## target rules ########################
 
436
 
 
437
all debug ::
 
438
        @echo "****> Make $@ by $(ID)@$(HOST) at $(MAKE_START) on $(CONFIG_GUESS)"
 
439
ifdef NANENV
 
440
        @for n in $(NANENV); do \
 
441
            echo "      $$n"; \
 
442
        done
 
443
endif
 
444
 
 
445
DIR = $(OCGDIR)
 
446
SOURCEDIR = source
 
447
 
 
448
include nan_subdirs.mk
 
449
 
 
450
################## target rules ########################
 
451
 
 
452
all:: link
 
453
 
 
454
debug debuglink::
 
455
        @$(MAKE) link DEBUG_DIR="debug/" NANENV=$(NANENV)
 
456
 
 
457
clean:: linkclean debuglinkclean
 
458
 
 
459
link: $(BINTARGETS)
 
460
        @echo "****> Build $(MAKE_START) - `date '+%H:%M:%S %d-%b-%Y'`"
 
461
ifdef NANENV
 
462
        @for n in $(NANENV); do \
 
463
            echo "      $$n"; \
 
464
        done
 
465
endif
 
466
 
 
467
linkclean:
 
468
        @$(RM) -r $(DIR)/blenderstatic* \
 
469
                  $(DIR)/blenderplayer* \
 
470
                  $(DIR)/bin/*
 
471
 
 
472
debuglinkclean:
 
473
        @$(RM) -r $(DIR)/debug/blenderstatic* \
 
474
                  $(DIR)/debug/blenderplayer* \
 
475
                  $(DIR)/debug/bin/*
 
476
 
 
477
# Shortcut for Tinderbox release builds. Mortals don't use this.
 
478
release:
 
479
        @$(MAKE) -C ../release/ all || exit 1;
 
480
 
 
481
############### Linker rules ###############
 
482
 
 
483
blenderstatic: $(DIR)/$(DEBUG_DIR)bin/blenderstatic
 
484
blenderdynamic: $(DIR)/$(DEBUG_DIR)bin/blender$(EXT)
 
485
blenderplayer: $(DIR)/$(DEBUG_DIR)bin/blenderplayer$(EXT)
 
486
blenderdynplayer: $(DIR)/$(DEBUG_DIR)bin/blenderdynplayer$(EXT)
 
487
 
 
488
# XPCOM connector only for linux so far...
 
489
ifeq ($(OS),linux)
 
490
    xplink: $(DIR)/$(DEBUG_DIR)bin/Blender3DPlugin$(SOEXT)
 
491
endif
 
492
 
 
493
# Moz/NS plugin:
 
494
ifeq ($(OS),$(findstring $(OS), "freebsd linux irix solaris"))
 
495
    plugin: $(DIR)/$(DEBUG_DIR)bin/npBlender3DPlugin$(SOEXT)
 
496
    ptest: $(DIR)/$(DEBUG_DIR)bin/npTestPlugin$(SOEXT)
 
497
endif
 
498
# Windows needs a 8.3 name... Why? Dunno...
 
499
ifeq ($(OS),windows)
 
500
        ifneq ($(FREE_WINDOWS),true)
 
501
            plugin: $(DIR)/$(DEBUG_DIR)npB3DPlg$(SOEXT)
 
502
        endif
 
503
endif
 
504
 
 
505
$(DIR)/$(DEBUG_DIR)bin/blenderstatic: $(OBJS) $(GRPLIB) $(COMLIB) $(PULIB)
 
506
        @echo "****> Link $@"
 
507
ifdef NAN_BUILDINFO
 
508
        $(CCC) $(REL_CFLAGS) -DBUILD_DATE='"$(BUILD_DATE)"' -DBUILD_TIME='"$(BUILD_TIME)"' -DBUILD_REV='"$(BUILD_REV)"' -DBUILD_PLATFORM='"$(CONFIG_GUESS)"' -DBUILD_TYPE='"static"' $(BUILDINFO_C) -c -o $(BUILDINFO_O) -DNAN_BUILDINFO
 
509
endif
 
510
        mkdir -p $(DIR)/$(DEBUG_DIR)bin
 
511
        $(CCC) $(LDFLAGS) -o $(DIR)/$(DEBUG_DIR)bin/blenderstatic $(BUILDINFO_O) $(OBJS) $(GRPLIB) $(COMLIB) $(PULIB) $(LLIBS) $(SADD) $(LOPTS)
 
512
ifdef NAN_BUILDINFO
 
513
        /bin/rm $(BUILDINFO_O)
 
514
endif
 
515
ifeq ($(OS), darwin)
 
516
        @$(MAKE) -C darwin/ APPLICATION=blenderstatic
 
517
endif
 
518
 
 
519
$(DIR)/$(DEBUG_DIR)bin/blender$(EXT): $(OBJS) $(GRPLIB) $(COMLIB) $(PULIB)
 
520
        @echo "****> Link $@"
 
521
ifdef NAN_BUILDINFO
 
522
        $(CCC) $(REL_CFLAGS) -DBUILD_DATE='"$(BUILD_DATE)"' -DBUILD_TIME='"$(BUILD_TIME)"' -DBUILD_REV='"$(BUILD_REV)"' -DBUILD_PLATFORM='"$(CONFIG_GUESS)"' -DBUILD_TYPE='"dynamic"' $(BUILDINFO_C) -c -o $(BUILDINFO_O) -DNAN_BUILDINFO
 
523
endif
 
524
        mkdir -p $(DIR)/$(DEBUG_DIR)bin
 
525
        $(CCC) $(LDFLAGS) -o $(DIR)/$(DEBUG_DIR)bin/blender$(EXT) $(BUILDINFO_O) $(OBJS) $(GRPLIB) $(COMLIB) $(PULIB) $(LLIBS) $(DADD) $(LOPTS)
 
526
ifdef NAN_BUILDINFO
 
527
        /bin/rm $(BUILDINFO_O)
 
528
endif
 
529
ifeq ($(OS), darwin)
 
530
        @$(MAKE) -C darwin/ APPLICATION=blender
 
531
endif
 
532
 
 
533
$(DIR)/$(DEBUG_DIR)bin/blenderplayer$(EXT): $(OBJS) $(SPLIB1) $(COMLIB) $(SPLIB)
 
534
        @echo "****> Link $@"
 
535
ifdef NAN_BUILDINFO
 
536
        $(CCC) $(REL_CFLAGS) -DBUILD_DATE='"$(BUILD_DATE)"' -DBUILD_TIME='"$(BUILD_TIME)"' -DBUILD_REV='"$(BUILD_REV)"' -DBUILD_PLATFORM='"$(CONFIG_GUESS)"' -DBUILD_TYPE='"dynamic"' $(BUILDINFO_C) -c -o $(BUILDINFO_O) -DNAN_BUILDINFO
 
537
endif
 
538
        mkdir -p $(DIR)/$(DEBUG_DIR)bin
 
539
        $(CCC) $(LDFLAGS) -o $(DIR)/$(DEBUG_DIR)bin/blenderplayer$(EXT) $(BUILDINFO_O) $(OBJS) $(SPLIB1) $(COMLIB) $(SPLIB) $(LLIBS) $(DADD) $(LOPTS)
 
540
ifdef NAN_BUILDINFO
 
541
        /bin/rm $(BUILDINFO_O)
 
542
endif
 
543
ifeq ($(OS), darwin)
 
544
        @$(MAKE) -C darwin/ APPLICATION=blenderplayer
 
545
endif
 
546
 
 
547
$(DIR)/$(DEBUG_DIR)bin/blenderdynplayer$(EXT): $(OBJS) $(COMLIB) $(SPLIB)
 
548
        @echo "****> Link $@"
 
549
ifdef NAN_BUILDINFO
 
550
        $(CCC) $(REL_CFLAGS) -DBUILD_DATE='"$(BUILD_DATE)"' -DBUILD_TIME='"$(BUILD_TIME)"' -DBUILD_REV='"$(BUILD_REV)"' -DBUILD_PLATFORM='"$(CONFIG_GUESS)"' -DBUILD_TYPE='"dynamic"' $(BUILDINFO_C) -c -o $(BUILDINFO_O) -DNAN_BUILDINFO
 
551
endif
 
552
        mkdir -p $(DIR)/$(DEBUG_DIR)bin
 
553
        $(CCC) $(LDFLAGS) -o $(DIR)/$(DEBUG_DIR)bin/blenderdynplayer$(EXT) $(BUILDINFO_O) $(OBJS) $(SPLIB1) $(COMLIB) $(SPLIB) $(LLIBS) $(DADD) $(LOPTS)
 
554
ifdef NAN_BUILDINFO
 
555
        /bin/rm $(BUILDINFO_O)
 
556
endif
 
557
ifeq ($(OS), darwin)
 
558
        @$(MAKE) -C darwin/ APPLICATION=blenderplayer
 
559
endif
 
560
 
 
561
$(DIR)/$(DEBUG_DIR)bin/Blender3DPlugin$(SOEXT): $(PLUGAPPLIB_XPLINK)
 
562
        @echo "****> Link $@"
 
563
ifdef NAN_BUILDINFO
 
564
        $(CCC) $(REL_CFLAGS) -DBUILD_DATE='"$(BUILD_DATE)"' -DBUILD_TIME='"$(BUILD_TIME)"' -DBUILD_REV='"$(BUILD_REV)"' -DBUILD_PLATFORM='"$(CONFIG_GUESS)"' -DBUILD_TYPE='"dynamic"' $(BUILDINFO_C) -c -o $(BUILDINFO_O) -DNAN_BUILDINFO
 
565
endif
 
566
        mkdir -p $(DIR)/$(DEBUG_DIR)bin
 
567
        $(CCC) $(DYNLDFLAGS) -o $@ $(PLUGAPPLIB_XPLINK) $(LOPTS)
 
568
ifdef NAN_BUILDINFO
 
569
        /bin/rm $(BUILDINFO_O)
 
570
endif
 
571
 
 
572
# Windows build needs a def file? Why? For exposing functions from the
 
573
# dll to the outside world. However, this is alsi done internally..
 
574
DEFFILE = ./gameengine/GamePlayer/netscape/src/npB3DPlg.def
 
575
 
 
576
# Windows needs a specific name format for dll.s so we give it one.
 
577
$(DIR)/$(DEBUG_DIR)npB3DPlg$(SOEXT): $(NSPLUGLIB) $(PLUGAPPLIB) $(COMLIB) $(SPLIB)
 
578
        @echo "****> Link $@"
 
579
ifdef NAN_BUILDINFO
 
580
        $(CCC) $(REL_CFLAGS) -DBUILD_DATE='"$(BUILD_DATE)"' -DBUILD_TIME='"$(BUILD_TIME)"' -DBUILD_REV='"$(BUILD_REV)"' -DBUILD_PLATFORM='"$(CONFIG_GUESS)"' -DBUILD_TYPE='"dynamic"' $(BUILDINFO_C) -c -o $(BUILDINFO_O) -DNAN_BUILDINFO
 
581
endif
 
582
#       $(CCC) $(DYNLDFLAGS) -o $@ $(NSPLUGLIB) $(PLUGAPPLIB) $(COMLIB) $(SPLIB) $(PLUGREMLIB) $(LLIBS) $(DADD) $(LOPTS) 
 
583
        $(CCC) $(DYNLDFLAGS) -o $@ $(NSPLUGLIB) $(PLUGAPPLIB) $(COMLIB) $(SPLIB) $(PLUGREMLIB) $(LLIBS) $(DADD) $(LOPTS) /def:$(DEFFILE)
 
584
ifdef NAN_BUILDINFO
 
585
        /bin/rm $(BUILDINFO_O)
 
586
endif
 
587
 
 
588
$(DIR)/$(DEBUG_DIR)bin/npBlender3DPlugin$(SOEXT): $(NSPLUGLIB) $(PLUGAPPLIB) $(COMLIB) $(SPLIB)
 
589
        @echo "****> Link $@"
 
590
ifdef NAN_BUILDINFO
 
591
        $(CCC) $(REL_CFLAGS) -DBUILD_DATE='"$(BUILD_DATE)"' -DBUILD_TIME='"$(BUILD_TIME)"' -DBUILD_REV='"$(BUILD_REV)"' -DBUILD_PLATFORM='"$(CONFIG_GUESS)"' -DBUILD_TYPE='"dynamic"' $(BUILDINFO_C) -c -o $(BUILDINFO_O) -DNAN_BUILDINFO
 
592
endif
 
593
        mkdir -p $(DIR)/$(DEBUG_DIR)bin
 
594
        $(CCC) $(DYNLDFLAGS) -o $@ $(NSPLUGLIB) $(PLUGAPPLIB) $(COMLIB) $(SPLIB) $(PLUGREMLIB) $(LLIBS) $(DADD) $(LOPTS)
 
595
ifdef NAN_BUILDINFO
 
596
        /bin/rm $(BUILDINFO_O)
 
597
endif
 
598
 
 
599
$(DIR)/$(DEBUG_DIR)bin/npTestPlugin$(SOEXT): $(NSPLUGLIB)
 
600
        @echo "****> Link $@"
 
601
ifdef NAN_BUILDINFO
 
602
        $(CCC) $(REL_CFLAGS) -DBUILD_DATE='"$(BUILD_DATE)"' -DBUILD_TIME='"$(BUILD_TIME)"' -DBUILD_REV='"$(BUILD_REV)"' -DBUILD_PLATFORM='"$(CONFIG_GUESS)"' -DBUILD_TYPE='"dynamic"' $(BUILDINFO_C) -c -o $(BUILDINFO_O) -DNAN_BUILDINFO
 
603
endif
 
604
        mkdir -p $(DIR)/$(DEBUG_DIR)bin
 
605
        $(CCC) $(DYNLDFLAGS) -o $@ $(NSPLUGLIB) $(PLUGTESTLIB) $(LLIBS) $(DADD) $(LOPTS)
 
606
ifdef NAN_BUILDINFO
 
607
        /bin/rm $(BUILDINFO_O)
 
608
endif
 
609