#################################################
##              In the name of GOD
##
## Copyright (C) 2009-2012 Behnam Momeni.
## All rights reserved.
##
## This file is part of the Partov project.
##
#################################################

COMPILER = g++
FLAGS = -Wall -g -Ibase -Iuser
LIBS = -lpthread

TARGET = cf.out

BASE_SOURCES = base/main.cpp \
	base/cf.cpp \
	base/interface.cpp \
	base/machine.cpp \
	base/frame.cpp

USER_SOURCES = user/sm.cpp

BASE_OBJ = ${BASE_SOURCES:.cpp=.o}
BASE_OBJECTS = ${BASE_OBJ:.c=.o}

USER_OBJ = ${USER_SOURCES:.cpp=.o}
USER_OBJECTS = ${USER_OBJ:.c=.o}

OBJECTS = ${BASE_OBJECTS} ${USER_OBJECTS}

all: ${TARGET}

${TARGET}: ${OBJECTS}
	${COMPILER} ${FLAGS} -o ${TARGET} ${OBJECTS} ${LIBS}

clean:
	rm -f ${OBJECTS} ${TARGET} *~ base/*~ user/*~

.cpp.o:
	${COMPILER} ${FLAGS} -c $< -o $@
.c.o:
	${COMPILER} ${FLAGS} -c $< -o $@
