#-----------------------------------------------------------------------
# Change the following lines according to your compiler options
#-----------------------------------------------------------------------

CC= gcc
CCC = gcc
CXX = $(CCC)
DEBUG_FLAGS=-g
OPTIMIZATION=-O2

# for gcc, -Wall turns all the warnings on
OTHER_FLAGS=-Wall

# uncomment the following definition if your C++ compiler supports 'bool'
BOOL_FLAG= -DBOOL_DEFINED
# uncomment the following def. if your C++ compiler DOES NOT support 'bool'
#BOOL_FLAG=

# uncomment the following def. and put the correct value in it if your
# time.h does not provide a definition for CLOCKS_PER_SEC. The following
# value is for SunOS 4.1.3
#CLOCK_FLAG=-DCLOCKS_PER_SEC=1000000

# uncomment the following def if your time.h defines CLOCKS_PER_SEC
CLOCK_FLAG=


CFLAGS= $(OPTIMIZATION) $(DEBUG_FLAGS)  $(OTHER_FLAGS) \
          $(CLOCK_FLAG)
CCFLAGS= $(OPTIMIZATION) $(DEBUG_FLAGS) $(BOOL_FLAG) $(OTHER_FLAGS) \
          $(CLOCK_FLAG)
CXXFLAGS=$(CCFLAGS)
 
# Name of the C++ library of your system; usually is stdc++
CPLUSPLUS_LIB=stdc++


#-----------------------------------------------------------------------
# The following lines should not be changed
#-----------------------------------------------------------------------


OBJECTS=matcher.o graph.o error.o state.o match.o
ULL_OBJECTS=matcher.o graph.o error.o ull_state.o ull_match.o

all: matcher ull_matcher gene

matcher: $(OBJECTS)
	$(CCC) $(DEBUG_FLAGS) -o matcher $(OBJECTS) -lm -l$(CPLUSPLUS_LIB)


ull_matcher: $(ULL_OBJECTS)
	$(CCC) $(DEBUG_FLAGS) -o ull_matcher $(ULL_OBJECTS) -lm \
               -l$(CPLUSPLUS_LIB)

gene: gene.o
	$(CC) $(DEBUG_FLAGS) -o gene gene.o -lm

matcher.o: matcher.cc graph.h match.h

graph.o: graph.cc graph.h error.h

error.o: error.cc error.h

state.o: state.cc state.h graph.h error.h 

ull_state.o: ull_state.cc ull_state.h graph.h error.h 

match.o: match.cc match.h state.h graph.h error.h

ull_match.o: ull_match.cc ull_match.h ull_state.h graph.h error.h

