#!/usr/sbin/smake

# type 'make depend' whenever files or headers are added

# ================== Name changes happen here only ==============
LIBTARGET = libgprims.a
TEST = test
# C files with .c extension
CSOURCES = constants
# C++ files with .C extension 
C++SOURCES = utils float2 float3 float4 
# object sources if needed, not to be build !!! CHANGE MAKE CLEAN !!!
OSOURCES = test.o
# ===============================================================

# ------------------- Compiler options ------------------------- 
CCFLAGS = -g -fullwarn -MDupdate Makedepend -ansi
CFLAGS = -g -fullwarn -MDupdate Makedepend -ansi
INCLDIR = -I/usr/include/CC -I/usr/include -I.
LIBS = -lgprims -lm
LIBSDIR = -L. 

# ---------------------------------------------------------------

# This is processed automatically
SOURCEFILES = $(C++SOURCES:=.C) $(CSOURCES:=.c)
OBJECTFILES = $(C++SOURCES:=.o) $(CSOURCES:=.o) 

# --- Begins compiling files --- Don't forget to do make depend after any add

$(TARGET):  $(OBJECTFILES)
	CC $(CCFLAGS) $(LIBSDIR) -o $(TARGET) $(OSOURCES) $(OBJECTFILES) $(LIBS)

$(LIBTARGET): $(OBJECTFILES)
	/bin/rm -f $(LIBTARGET)
	ar crlv $(LIBTARGET) $(OBJECTFILES)

.c.o:
	CC $(INCLDIR) $(CCFLAGS) -c -o $(.TARGET)  $<

.C.o:
	CC $(INCLDIR) $(CCFLAGS) -c -o $(.TARGET)  $<

clean:
	rm *~ *.o $(LIBTARGET) $(TARGET) core

# -------------------------------

# --- This builds dependencies

depend:
	makedepend $(INCLDIR) $(SOURCEFILES)

# -------------------------------

clean2:
	rm -f *~ *.o core
	make depend

backup:
	cp *.[Cch] Makefile Backup/

ema:
	emacs *.[CHh] &

update: *.[Cch] *.fd Makefile
	cp *.[Cch] Makefile link/


# Useful CVS Repository dir and includes :
# 
# -L${BASE}/src/city/lib
# -I. -I$(BASE)/src -I$(BASE)/src/newgeom
# -DDOUBLE
# -lnewgeom_dbl -lm 
# -lshapes -lfeas -llp -llp2d -lgeom -lmisc -lrand -larg -lm -llist -lui
# -lGLw -lGLU -lGL -lXext -lX11 -lXm -lXt -lifl -lInventor

# Eric Amram, Oct 1997

# ******************** Makedepend performs here *******************
#
# Be sure to let a blank line after this one 

# DO NOT DELETE

utils.o: /usr/include/CC/iostream.h /usr/include/memory.h
utils.o: /usr/include/stdlib.h /usr/include/standards.h
utils.o: /usr/include/sgidefs.h /usr/include/math.h utils.H
utils.o: /usr/include/assert.h constants.H
float2.o: float2.H /usr/include/assert.h /usr/include/math.h
float2.o: /usr/include/sgidefs.h /usr/include/standards.h utils.H
float2.o: /usr/include/CC/iostream.h /usr/include/memory.h constants.H
float3.o: /usr/include/CC/iostream.h /usr/include/memory.h
float3.o: /usr/include/string.h /usr/include/standards.h /usr/include/math.h
float3.o: /usr/include/sgidefs.h /usr/include/assert.h utils.H constants.H
float3.o: float2.H float3.H /usr/include/stddef.h float4.H
float4.o: /usr/include/CC/iostream.h /usr/include/memory.h
float4.o: /usr/include/math.h /usr/include/sgidefs.h /usr/include/standards.h
float4.o: /usr/include/assert.h float4.H utils.H constants.H float3.H
float4.o: /usr/include/stddef.h
