from __future__ import division, print_function, unicode_literals

import os

Import('env') # inherit from parent

# math libs
mlib = env['RAD_MLIB']
addobj = env.get('ADDOBJNOTIFY')

# standard targets
bbox = env.Object(source='bbox.c')
o_face = env.Object(source='o_face.c')
PROGS = (
('oconv',    Split('''oconv.c writeoct.c initotypes.c sphere.c
				   o_cone.c o_instance.c''') +[bbox, o_face], []),
('getbbox',  Split('getbbox.c readobj2.c init2otypes.c') +[bbox], []),
('obj2mesh', Split('obj2mesh.c cvmesh.c wfconv.c writemesh.c')+[o_face,addobj],
 []),
)
for p in PROGS:
    prog = env.Program(target=os.path.join(env['RAD_BUILDBIN'], p[0]),
			source=p[1], LIBS=['rtrad']+p[2]+mlib)
    Default(prog)
    env.Append(RAD_BININSTALL=[env.Install(env['RAD_BINDIR'], prog)])


# vim: set syntax=python:
# vi: set ts=4 sw=4 :
