# FILTERS/toy/Makefile
############################################################################

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

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

# NOTE: replace "TOY" and "toy"
# by the name of your filter (everywhere in this file)
# these variables shall be defined in Config.common/Config.site
# TOY_INCLUDES =
# TOY_LIBS = 

# NOTE: also add a variable TOY to Config.common/Config.site, that is set
# to the name of this directory in case support for this filter needs to be
# compiled in, and which is set to an empty string if no support is to be
# compiled in.
# Add $(TOY) to the lst of subdirectories in the SUBDIRS variable of
# ../Makefile (the Makefile in the FILTERS directory)

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

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

# default target: make the toy filter library
all: libxrml2toy

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

# 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
libxrml2toy: $(OBJECTS)
	$(MKTOOLDIR)/$(MKLIB) libxrml2toy.$(LIBEXT) $(MAJOR_VERSION) $(MINOR_VERSION) $(RELEASE) $(OBJECTS)
	$(MOVE) libxrml2toy* $(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) libxrml2toy.*

clean: cleanhere

distclean: cleanhere

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