#	---------------------------------------------------------------------------------
#
#	Makefile.am
#
#	This is a template make file that builds both the pgjobs agent (pgjobsagent) and
#	the pgjobs configuration tool (pgjobs).
#
#	Project: pgjobs
#	Author: Zlatko Michailov
#	Created: 26-Jul-2003
#	Updated:  3-Aug-2003
#	Updated:  2-Oct-2003
#   Updated:  6-Oct-2003
#	Updated: 13-Oct-2003
#	Updated:  7-May-2004
#	Updated:  9-Jun-2004
#
#	This file is provided as is, with no warranty. Use at your own risk.
#
#	Copyright (c) 2003-2004, Zlatko Michailov
#
#	---------------------------------------------------------------------------------



CONF_EXE=pgjobs
CONF_OBJ=pgjobs.o config.o config-test.o resources.o


AGENT_EXE=pgjobsagent
AGENT_OBJ=pgjobsagent.o utils.o resources.o \
		config.o config-test.o \
		log.o log-test.o \
		agent.o dbagent.o masteragent.o


OPT_COMPILE=-pedantic
####OPT_COMPILE=-pedantic -ggdb -D_DEBUG
LIB=/usr/lib/libstdc++.so.5 /usr/lib/libpthread.so



all: ${CONF_EXE} ${AGENT_EXE}

clean:
	-rm -f *.o 
	-rm ${CONF_EXE}
	-rm ${AGENT_EXE}

${CONF_EXE}: ${CONF_OBJ}
	gcc -o ${CONF_EXE} ${OPT_COMPILE} ${CONF_OBJ} ${LIB}

${AGENT_EXE}: ${AGENT_OBJ}
	gcc -o ${AGENT_EXE} ${OPT_COMPILE} ${AGENT_OBJ} ${LIB}

.cpp.o:
	gcc -c -o $@ ${OPT_COMPILE} $<

*.cpp: *.h makefile
	touch $@


