################################################################################
################################################################################
##
## Example Makefile for SAAPHIRE effects.
##
## File supervisor: SOFTIMAGE Toolkits & Custom F/X team.
##
## (c) Copyright 1995, SOFTIMAGE Inc.
##
################################################################################
################################################################################


# Set TARGET to this Makefile's target.
TARGET = blend.so

# I've added the TARGET_DIR where the .so file will be copied
# (Marc Evers 17/7/96)
TARGET_DIR = ../custom

# (Marc Evers 17/7/96)
INCLUDES = -I/usr/people/preston/martins_work/nurbs/include \
	   -I../blend

# Set CSRC to this Makefile's C sources.
CSRC =  blend.c blending.c convert.c oslo.c \
	nurb1.c nurb2.c nurb3.c nurb4.c nurb5.c nurb6.c tran.c

# Set LIBS to this Makefile's libraries.
LIBS = 
#/usr/people/preston/martins_work/nurbs/library/libnurb.so

# Set INST_DIR to the installation directory which is where the target is to be
# installed.  This is used only if you "make install".
INST_DIR = ../../dso

# Set SAA_TOP to where SAAPHIRE is installed.
#* Modified by M.J.Evers, 16/7/96
SAA_TOP = /usr/softimage/SDK/SAAPHIRE

# Set CC to your C or C++ compiler if different from make's default which is
# normally cc.
CC = cc

# Set CFLAGS to your C or C++ compiler flags.  You need at least -I$(SAA_INC).
CFLAGS = -Xcpluscomm -O2 -fullwarn -h/usr/people/preston/martins_work/nurbs/source \
	 -I. -I$(SAA_INC) $(INCLUDES)

# Set LD to your link edit if different from make's default which is normally
# ld.
#LD = ld

# Set LDFLAGS to your like editor flags.
LDFLAGS = -rdata_shared

# OBJS is set to the set of all objects.
OBJS = $(CSRC:.c=.o)
#NRBOBJ = nurb1.o nurb2.o nurb3.o nurb4.o nurb5.o nurb6.o tran.o

# Put your desired make options here.
.MAKEOPTS: -O

# This Makefile uses the Bourne shell.
#SHELL = /bin/sh

# The following are subdirectories within SAAPHIRE.
SAA_INC = $(SAA_TOP)/h
SAA_DSO = $(SAA_TOP)/dso

# The following are the SAAPHIRE libraries that you need to link to.
SAA_LIBS = $(SAA_DSO)/libSAA.so 


# Rules to build a shared library.
.SUFFIXES: .so
.a.so:
	$(LD) $(LDFLAGS) -shared -o $*.so -all $< $(LIBS) $(SAA_LIBS)
.o.so:
	$(LD) $(LDFLAGS) -shared -o $*.so $(OBJS) $(LIBS) $(SAA_LIBS)
	mv $(TARGET) $(TARGET_DIR)

# Default rule.
$(TARGET): $(OBJS) $(LIBS) $(SAA_LIBS)



# Rule to remove intermediate files but leave the target intact.
clean:
	rm -f $(OBJS)

# Rule to remove everything before remaking from scratch.
clobber: clean
	rm -f $(TARGET)

# Other rules can be put here.

blend:
	@cd ../blend; $(MAKE) local

prlib: 
	$(CC) $(CFLAGS) -c ~preston/martins_work/nurbs/source/nurb1.c
	$(CC) $(CFLAGS) -c ~preston/martins_work/nurbs/source/nurb2.c
	$(CC) $(CFLAGS) -c ~preston/martins_work/nurbs/source/nurb3.c
	$(CC) $(CFLAGS) -c ~preston/martins_work/nurbs/source/nurb4.c
	$(CC) $(CFLAGS) -c ~preston/martins_work/nurbs/source/nurb5.c
	$(CC) $(CFLAGS) -c ~preston/martins_work/nurbs/source/nurb6.c
	$(CC) $(CFLAGS) -c ~preston/martins_work/nurbs/source/tran.c
