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

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

TARGET = server

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

USER_SOURCES = user/server.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: server client

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

client: user/client.cpp
	${COMPILER} ${FLAGS} -o client user/client.cpp ${LIBS}

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

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