# FILTERS/ply/Makefile
############################################################################

# use same configuration parameters as in parent directory
include ../../Config.common
include ../../Config.site

POOLSDIR = ../../POOLS
INCLUDIR = ../../include
LIBDIR = ../../lib
MKTOOLDIR = ../../MKTOOLS

# should be defined in Config.site
# PLYFLAGS =
# PLYLIBS =

############################################################################
# No need to change anything below here
############################################################################
# the source files in this directory
CXXSOURCES = importer.C
CSOURCES = 
SOURCES = $(CXXSOURCES) $(CSOURCES)
OBJECTS = ${CXXSOURCES:.C=.o} ${CSOURCES:.c=.o}

# platform independent compiler and linker flags specific for this 
# directory
THISDIRFLAGS = -I$(INCLUDIR)/ply -I$(INCLUDIR) -I$(POOLSDIR) -I$(PLYFLAGS) $(MKLIBFLAGS)

# default target: make the xrml<->ply filter library
all: libply2xrml

# link include files to ply subdirectory of $(INCLUDIR)
link_includes:
	-mkdir $(INCLUDIR)/ply
	-ln -sf `pwd`/*.[hH] $(INCLUDIR)/ply

# generate source file dependencies
dependhere:
	$(MAKEDEPEND) $(MKDEPFLAGS) $(SOURCES) > deps

# also recurses subdirectories if any
depend: dependhere

# compile the sources in this directory only
here: $(OBJECTS)

# make the filter library
libply2xrml: $(OBJECTS)
	$(MKTOOLDIR)/$(MKLIB) libply2xrml.$(LIBEXT) $(MAJOR_VERSION) $(MINOR_VERSION) $(RELEASE) $(OBJECTS)
	$(MOVE) libply2xrml* $(LIBDIR)

# make a clean source tree again. cleangen is a target defined in
# Config.common. (Links in the $(INCLUDIR) and $(LIBDIR) directories
# are removed by make distclean in the main directory.
cleanhere: cleangen
	-$(RM) libply2xrml.*

clean: cleanhere

distclean: cleanhere

###############################################################################
# dependencies --- automatically generated with make depend !!
###############################################################################
-include deps
