src/SConscript
author Radek Brich <radek.brich@devl.cz>
Wed, 09 Apr 2008 16:51:14 +0200
branchpyrit
changeset 63 440e1ae80459
parent 61 7006036eb0db
child 65 242839c6d27d
permissions -rw-r--r--
add many SCons targets (see DEVNOTES) make automatic model downloading work again remove Makefiles -- now obsolete and hardly maintainable
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
63
440e1ae80459 add many SCons targets (see DEVNOTES)
Radek Brich <radek.brich@devl.cz>
parents: 61
diff changeset
     1
Import('env')
440e1ae80459 add many SCons targets (see DEVNOTES)
Radek Brich <radek.brich@devl.cz>
parents: 61
diff changeset
     2
env.Append(CPPPATH = '#include')
60
a23b5089b9c3 moving to SCons build system
Radek Brich <radek.brich@devl.cz>
parents:
diff changeset
     3
a23b5089b9c3 moving to SCons build system
Radek Brich <radek.brich@devl.cz>
parents:
diff changeset
     4
import os
a23b5089b9c3 moving to SCons build system
Radek Brich <radek.brich@devl.cz>
parents:
diff changeset
     5
PY_CCFLAGS = os.popen('python-config --includes').read()
a23b5089b9c3 moving to SCons build system
Radek Brich <radek.brich@devl.cz>
parents:
diff changeset
     6
PY_LDFLAGS = os.popen('python-config --libs').read()
a23b5089b9c3 moving to SCons build system
Radek Brich <radek.brich@devl.cz>
parents:
diff changeset
     7
pyenv = env.Clone()
a23b5089b9c3 moving to SCons build system
Radek Brich <radek.brich@devl.cz>
parents:
diff changeset
     8
pyenv.Append(LINKFLAGS=PY_LDFLAGS, CCFLAGS=PY_CCFLAGS)
a23b5089b9c3 moving to SCons build system
Radek Brich <radek.brich@devl.cz>
parents:
diff changeset
     9
a23b5089b9c3 moving to SCons build system
Radek Brich <radek.brich@devl.cz>
parents:
diff changeset
    10
sources = [
a23b5089b9c3 moving to SCons build system
Radek Brich <radek.brich@devl.cz>
parents:
diff changeset
    11
	'raytracer.cc', 'scene.cc', 'sampler.cc',
a23b5089b9c3 moving to SCons build system
Radek Brich <radek.brich@devl.cz>
parents:
diff changeset
    12
	'container.cc', 'kdtree.cc', 'octree.cc', 'noise.cc']
a23b5089b9c3 moving to SCons build system
Radek Brich <radek.brich@devl.cz>
parents:
diff changeset
    13
a23b5089b9c3 moving to SCons build system
Radek Brich <radek.brich@devl.cz>
parents:
diff changeset
    14
objs = []
a23b5089b9c3 moving to SCons build system
Radek Brich <radek.brich@devl.cz>
parents:
diff changeset
    15
shared_objs = []
a23b5089b9c3 moving to SCons build system
Radek Brich <radek.brich@devl.cz>
parents:
diff changeset
    16
for src in sources:
a23b5089b9c3 moving to SCons build system
Radek Brich <radek.brich@devl.cz>
parents:
diff changeset
    17
	objs.append( env.Object(src) )
a23b5089b9c3 moving to SCons build system
Radek Brich <radek.brich@devl.cz>
parents:
diff changeset
    18
	shared_objs.append( env.SharedObject(src) )
a23b5089b9c3 moving to SCons build system
Radek Brich <radek.brich@devl.cz>
parents:
diff changeset
    19
a23b5089b9c3 moving to SCons build system
Radek Brich <radek.brich@devl.cz>
parents:
diff changeset
    20
pymodule = pyenv.SharedLibrary(
a23b5089b9c3 moving to SCons build system
Radek Brich <radek.brich@devl.cz>
parents:
diff changeset
    21
	['raytracermodule.cc']+shared_objs,
a23b5089b9c3 moving to SCons build system
Radek Brich <radek.brich@devl.cz>
parents:
diff changeset
    22
	SHLIBPREFIX = '',
a23b5089b9c3 moving to SCons build system
Radek Brich <radek.brich@devl.cz>
parents:
diff changeset
    23
	CCFLAGS = '$CCFLAGS -Wno-write-strings')
a23b5089b9c3 moving to SCons build system
Radek Brich <radek.brich@devl.cz>
parents:
diff changeset
    24
61
7006036eb0db minor SConscript tweaking
Radek Brich <radek.brich@devl.cz>
parents: 60
diff changeset
    25
lib = env.StaticLibrary('pyrit', objs)
7006036eb0db minor SConscript tweaking
Radek Brich <radek.brich@devl.cz>
parents: 60
diff changeset
    26
63
440e1ae80459 add many SCons targets (see DEVNOTES)
Radek Brich <radek.brich@devl.cz>
parents: 61
diff changeset
    27
env.Alias('objs', objs)
440e1ae80459 add many SCons targets (see DEVNOTES)
Radek Brich <radek.brich@devl.cz>
parents: 61
diff changeset
    28
env.Alias('static-lib', lib)
440e1ae80459 add many SCons targets (see DEVNOTES)
Radek Brich <radek.brich@devl.cz>
parents: 61
diff changeset
    29
env.Alias('shared-objs', shared_objs)
440e1ae80459 add many SCons targets (see DEVNOTES)
Radek Brich <radek.brich@devl.cz>
parents: 61
diff changeset
    30
env.Alias('python-module', pymodule)
440e1ae80459 add many SCons targets (see DEVNOTES)
Radek Brich <radek.brich@devl.cz>
parents: 61
diff changeset
    31
env.Alias('libs', ['static-lib', 'python-module'])
440e1ae80459 add many SCons targets (see DEVNOTES)
Radek Brich <radek.brich@devl.cz>
parents: 61
diff changeset
    32
61
7006036eb0db minor SConscript tweaking
Radek Brich <radek.brich@devl.cz>
parents: 60
diff changeset
    33
Return('lib pymodule')