#      Copyright (C) 1994, 1995, Alias Research, Inc.
#
#      These coded instructions, statements and computer programs contain
#      unpublished information proprietary to Alias Research, Inc.  and are
#      rotected by the Canadian and US Federal copyright law. They may not
#      be disclosed to third parties  or copied  or duplicated, in whole or
#      in part,  without the prior written consent of Alias Research,  Inc.
#
#      Unpublished-rights reserved under the Copyright Laws 
# 	of the United States.


#
# This makefile builds example plugins for both ms2 and soundsync.  Both 
# look for plugins in a list of directories specified by the environment 
# variable ALIAS_PLUGIN_PATH.  
#
# example:
#    setenv ALIAS_PLUGIN_PATH	.:~/plugins:/usr/aliasbeta/plugins  
#
# In the example, ms2 and soundsync will look first in the current directory, 
# then in a  directory in your home area called plugins, and finally in the
# installation area. If you would like to try the example plugins or some of
# your own, modify the variable ALIAS_PLUGIN_PATH to search an area wherever
# you install them. 
#

# change this macro to reflect the location of PDL include files at your site
PLUGIN_HEADERS = /oyster/alias_cut/PDL/include

# change this to where your plugins are located at your site.
PLUGIN_DIR = /oyster/plugins
HELP_DIR = $(PLUGIN_DIR)/Help

INSTALL = install

C++FLAGS = -w -O -I. -I$(PLUGIN_HEADERS) 
CFLAGS = -w -O -I. -I$(PLUGIN_HEADERS) 

SOURCES = clock.s.so mouse.s.so const.s.so timing.s.so import_xfm.s.so	\
          slider.s.so FastTrak.s.so afob.s.so microphone.s.so 		\
	  audio.s.so UltraTrak.s.so monkey.s.so dag.s.so file_import.s.so \
          toggle.s.so random.s.so

FILTERS = util.f.so clip.f.so offset.f.so accel.f.so spring.f.so 	\
	  print.f.so collide.f.so delay.f.so joins.f.so splits.f.so 	\
	  xformutil.f.so dsjoint.f.so buildXform.f.so gate.f.so         \
          makebool.f.so

SINKS   = print.k.so export_xfm.k.so dag.k.so group.k.so

RECOGS  = volume.r.so

TARGETS = $(SOURCES) $(FILTERS) $(SINKS) $(RECOGS)

HELP_FILES = Clip.f.help Clip3.f.help Clock.s.help ConstFloat.s.help      \
             ConstInt.s.help Mouse.s.help Negate.f.help Negate3.f.help    \
             Offset.f.help Offset3.f.help                                 \
             PrintInt.k.help PrintFloat.k.help                            \
             PrintFloat3.k.help PrintXform.k.help Timing.s.help           \
             ImportXform.s.help ExportXform.k.help DivFloats.f.help       \
             AddFloats.f.help MultFloats.f.help AccelVel3.f.help          \
             AccelVel.f.help FastTrak.s.help DtoA.f.help InCube.f.help    \
             InSphere.f.help PrintFloat.f.help PrintFloat3.f.help         \
             PrintXform.f.help SubFloats.f.help Slider.s.help AFOB.s.help \
	     Spring.f.help Microphone.s.help Audio.s.help AtoD.f.help	  \
	     UltraTrak.s.help 						  \
	     AddFloats3.f.help Monkey.s.help FloatJoin.f.help		  \
	     XformJoin.f.help XformSplit.f.help FloatSplit.f.help	  \
	     XformMult.f.help DAG.k.help DAG.s.help DAGGroup.k.help	  \
	     ImportTrcFile.s.help BuildXform.f.help GateFloat.f.help      \
             GateFloat3.f.help GateInt.f.help GateXform.f.help            \
             MakeBoolean.f.help Toggle.s.help Random.s.help


all: $(TARGETS)

# Sources

clock.s.so  : src_clock.o 
	CC -shared -ignore_unresolved -o clock.s.so src_clock.o

mouse.s.so  : src_mouse.o 
	CC -shared -ignore_unresolved -o mouse.s.so src_mouse.o

const.s.so  : src_const.o	 
	CC -shared -ignore_unresolved -o const.s.so src_const.o

timing.s.so  : src_timing.o	 
	CC -shared -ignore_unresolved -o timing.s.so src_timing.o

import_xfm.s.so : import_xfm.o
	CC -shared -ignore_unresolved -o import_xfm.s.so import_xfm.o

slider.s.so : slider.s.o
	CC -shared -ignore_unresolved -o slider.s.so slider.s.o

FastTrak.s.so : FastTrak.s.o FastTrakDriver.o
	CC -shared -ignore_unresolved -o FastTrak.s.so FastTrak.s.o FastTrakDriver.o

afob.s.so  : afob.s.o afob_driver.o afob_io.o afob_parse.o
	CC -shared -ignore_unresolved -o afob.s.so afob.s.o afob_driver.o afob_io.o afob_parse.o

microphone.s.so  : src_microphone.o
	CC -shared -ignore_unresolved -o microphone.s.so src_microphone.o 

audio.s.so: src_audio.o	
	CC -shared -ignore_unresolved -o audio.s.so src_audio.o

UltraTrak.s.so : UltraTrak.o
	CC -shared -ignore_unresolved -o UltraTrak.s.so UltraTrak.o

monkey.s.so : src_monkey.o monkeydriver.o
	CC -shared -ignore_unresolved -o monkey.s.so src_monkey.o monkeydriver.o

dag.s.so : src_dag.o
	CC -shared -ignore_unresolved -o dag.s.so src_dag.o

file_import.s.so  : file_import.o file_import_motion_anal.o
	CC -shared -ignore_unresolved -o file_import.s.so file_import.o file_import_motion_anal.o

toggle.s.so : src_toggle.o
	CC -shared -ignore_unresolved -o toggle.s.so src_toggle.o

random.s.so : src_random.o
	CC -shared -ignore_unresolved -o random.s.so src_random.o

# Filters

util.f.so : util.f.o
	CC -shared -ignore_unresolved -o util.f.so util.f.o

clip.f.so : filt_clip.o
	CC -shared -ignore_unresolved -o clip.f.so filt_clip.o

offset.f.so : filt_offset.o fancy_slider.o
	CC -shared -ignore_unresolved -o offset.f.so filt_offset.o fancy_slider.o

accel.f.so : accel.f.o
	CC -shared -ignore_unresolved -o accel.f.so accel.f.o

spring.f.so : spring.f.o
	CC -shared -ignore_unresolved -o spring.f.so spring.f.o

print.f.so : print.f.o
	CC -shared -ignore_unresolved -o print.f.so print.f.o

collide.f.so : collide.f.o
	CC -shared -ignore_unresolved -o collide.f.so collide.f.o

delay.f.so : filt_delay.o fancy_slider.o
	CC -shared -ignore_unresolved -o delay.f.so filt_delay.o fancy_slider.o

dsjoint.f.so : filt_dsjoint.o
	CC -shared -ignore_unresolved -o dsjoint.f.so filt_dsjoint.o

splits.f.so : filt_splits.o
	CC -shared -ignore_unresolved -o splits.f.so filt_splits.o

joins.f.so : filt_joins.o
	CC -shared -ignore_unresolved -o joins.f.so filt_joins.o

xformutil.f.so : filt_xformutil.o
	CC -shared -ignore_unresolved -o xformutil.f.so filt_xformutil.o

buildXform.f.so  : buildXform.f.o vector_util.o
	CC -shared -ignore_unresolved -o buildXform.f.so vector_util.o 

gate.f.so  : filt_gate.o 
	CC -shared -ignore_unresolved -o gate.f.so filt_gate.o

makebool.f.so  : filt_makebool.o 
	CC -shared -ignore_unresolved -o makebool.f.so filt_makebool.o

# Sinks

print.k.so  : sink_print.o 
	CC -shared -ignore_unresolved -o print.k.so sink_print.o

export_xfm.k.so  : export_xfm.o 
	CC -shared -ignore_unresolved -o export_xfm.k.so export_xfm.o

dag.k.so  : sink_dag.o 
	CC -shared -ignore_unresolved -o dag.k.so sink_dag.o

group.k.so  : sink_group.o PDLVec3Euler.o
	CC -shared -ignore_unresolved -o group.k.so sink_group.o

# Recogs

volume.r.so: RCVolume.o
	CC -shared -ignore_unresolved -o volume.r.so RCVolume.o

# Install
install:
	make -f Makefile.open installplugins 
	make -f Makefile.open installhelp

installplugins : $(TARGETS)
	$(INSTALL) -f $(PLUGIN_DIR) $(TARGETS) Volume.config

installhelp : $(HELP_FILES)
	$(INSTALL) -f $(HELP_DIR) $(HELP_FILES)

# Clean
clean:
	rm -f *.o *.so *.a core so_locations Makefile.dep 
