# $Id: makefile 4034 2008-10-03 01:17:40Z rares $

# Copyright (C) 2007 by The Regents of the University of California

# Redistribution of this file is permitted under the terms of the 
# BSD license

# Date: 03/27/2007
# Author: Rares Vernica <rares (at) ics.uci.edu>

TRUNK_PATH = ../
SEPIA_PATH = ./

include makefile.defs

all: subdirs duplicate.o example unittest perftest

sample.o: sample.h

duplicate.o: duplicate.h \
	$(TRUNK_PATH)util/simfuncs.h

sepia.o: sepia.h sample.h \
	simfunc/simdist.h simfunc/simvect.h \
	simfunc/editvect.h simfunc/jaccvect.h \
	cluster/cluster.h cluster/ftable.h \
	cluster/lexic.h cluster/medoids.h \
  cluster/clusters.h \
  ppdtable/ppdtable.h ppdtable/ppdentry.h \
	freqest/errorcorr.h freqest/record.h freqest/predicate.h freqest/freqest.h \
	$(TRUNK_PATH)util/simfuncs.h \
	$(TRUNK_PATH)util/input.h $(TRUNK_PATH)util/misc.h

example.o: sepia.h sample.h \
	simfunc/simdist.h simfunc/simvect.h \
	simfunc/editvect.h simfunc/jaccvect.h \
	cluster/cluster.h cluster/ftable.h \
	cluster/clusters.h \
  ppdtable/ppdtable.h ppdtable/ppdentry.h \
  freqest/errorcorr.h freqest/record.h freqest/predicate.h \
	$(TRUNK_PATH)util/simfuncs.h $(TRUNK_PATH)util/input.h

unittest.o: sepia.h sample.h \
	simfunc/simdist.h simfunc/simvect.h \
	simfunc/editvect.h simfunc/jaccvect.h \
	cluster/cluster.h cluster/ftable.h \
	cluster/clusters.h \
  ppdtable/ppdtable.h ppdtable/ppdentry.h \
  freqest/errorcorr.h freqest/record.h freqest/predicate.h \
	$(TRUNK_PATH)util/simfuncs.h $(TRUNK_PATH)util/input.h

perftest.o: sepia.h sample.h \
	simfunc/simdist.h simfunc/simvect.h \
	simfunc/editvect.h simfunc/jaccvect.h \
	cluster/cluster.h cluster/ftable.h \
	cluster/clusters.h \
  ppdtable/ppdtable.h ppdtable/ppdentry.h \
  freqest/errorcorr.h freqest/record.h freqest/predicate.h \
	$(TRUNK_PATH)util/simfuncs.h $(TRUNK_PATH)util/input.h


example: example.o sepia.o sample.o \
	simfunc/simvect.o simfunc/simdist.o \
	simfunc/editvect.o simfunc/jaccvect.o \
	cluster/clusters.o cluster/cluster.o cluster/ftable.o \
	cluster/lexic.o cluster/medoids.o \
	ppdtable/ppdtable.o ppdtable/ppdentry.o \
	ppdtable/ppdsample.o ppdtable/indexentry.o ppdtable/allrand.o \
	ppdtable/closelex.o ppdtable/closerand.o ppdtable/closeunique.o \
	freqest/errorcorr.o freqest/record.o freqest/predicate.o freqest/freqest.o \
	$(TRUNK_PATH)util/simfuncs.o $(TRUNK_PATH)util/gram.o \
	$(TRUNK_PATH)util/misc.o $(TRUNK_PATH)util/input.o

unittest: unittest.o sepia.o sample.o \
	simfunc/simvect.o simfunc/simdist.o \
	simfunc/editvect.o simfunc/jaccvect.o \
	cluster/clusters.o cluster/cluster.o cluster/ftable.o \
	cluster/lexic.o cluster/medoids.o \
	ppdtable/ppdtable.o ppdtable/ppdentry.o \
	ppdtable/ppdsample.o ppdtable/indexentry.o ppdtable/allrand.o \
	ppdtable/closelex.o ppdtable/closerand.o ppdtable/closeunique.o \
	freqest/errorcorr.o freqest/record.o freqest/predicate.o freqest/freqest.o \
	$(TRUNK_PATH)util/simfuncs.o $(TRUNK_PATH)util/gram.o \
	$(TRUNK_PATH)util/misc.o $(TRUNK_PATH)util/input.o

perftest: perftest.o sepia.o sample.o \
	simfunc/simvect.o simfunc/simdist.o \
	simfunc/editvect.o simfunc/jaccvect.o \
	cluster/clusters.o cluster/cluster.o cluster/ftable.o \
	cluster/lexic.o cluster/medoids.o \
	ppdtable/ppdtable.o ppdtable/ppdentry.o \
	ppdtable/ppdsample.o ppdtable/indexentry.o ppdtable/allrand.o \
	ppdtable/closelex.o ppdtable/closerand.o ppdtable/closeunique.o \
	freqest/errorcorr.o freqest/record.o freqest/predicate.o freqest/freqest.o \
	$(TRUNK_PATH)util/simfuncs.o $(TRUNK_PATH)util/gram.o \
	$(TRUNK_PATH)util/misc.o $(TRUNK_PATH)util/input.o


SUBDIRS = simfunc cluster ppdtable freqest

subdirs: $(SUBDIRS)

$(SUBDIRS):
	$(MAKE) -C $@ $(MAKECMDGOALS)

cluster: simfunc

ppdtable: simfunc

freqest: cluster ppdtable

clean: subdirs
	-rm *.o *~ example unittest perftest *.sep.*

.PHONY: all clean subdirs $(SUBDIRS)