# FILTERS/cso/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 "CSO" and "cso"
# by the name of your filter (everywhere in this file)
# these variables shall be defined in Config.common/Config.site
# CSO_INCLUDES =
# CSO_LIBS = 

# NOTE: also add a variable CSO 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 $(CSO) 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 = exporter.C importer.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)/cso -I$(INCLUDIR) -I$(POOLSDIR) $(PLYINCLUDES) $(MKLIBFLAGS)

# default target: make the cso filter library
all: libxrml2cso

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

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

clean: cleanhere

distclean: cleanhere

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