# VRML/PROGS/vrmlconv/Makefile
############################################################################

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

POOLSDIR = ../../POOLS
INCLUDIR = ../../include
LIBDIR = ../../lib
BINDIR = ../../bin

# filter support compile flags and libraries to link with
ifeq ($(PLY),ply)
PLYFLAGS = -DPLY
PLYFILTLIB = -lply2xrml $(PLYLIBS)
endif

MGFFLAGS = -DMGF
MGFFILTLIB = -lxrml2mgf

NFFFLAGS = -DNFF
NFFFILTLIB = -lxrml2nff

CSOFLAGS = -DCSO
CSOFILTLIB = -lxrml2cso

FILTFLAGS = $(PLYFLAGS) $(MGFFLAGS) $(NFFFLAGS) $(CSOFLAGS)
FILTLIBS = $(PLYFILTLIB) $(MGFFILTLIB) $(NFFFILTLIB) $(CSOFILTLIB) 

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

THISDIRFLAGS = $(FILTFLAGS) -I$(INCLUDIR) -I$(POOLSDIR)

#default target: compile
all: vrmlconv

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

vrmlconv: $(OBJECTS)
	$(CXX) $(LDFLAGS) -o vrmlconv $(OBJECTS) \
		-L$(LIBDIR) $(FILTLIBS) -lxrml \
		-L$(POOLSDIR) -lpools \
		$(DLLIB) -lm
	ln -sf `pwd`/vrmlconv $(BINDIR)

cleanhere: cleangen
	-${RM} vrmlconv

clean: cleanhere

distclean: cleanhere

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