# Edit this file to define constants and custom build targets.
# Please refer to the makemake documentation for more information.

# Useful directories

MYCODEDIR := .

# Directories to search for header files

SEARCHDIRS := -I- -I../common -I../angel -I../bridge -I../sql -I/usr/include/mysql

# makemake variables

LINKER       := g++
DEPENDFLAGS  := -g -Wall -Werror ${SEARCHDIRS}
TOUCHHEADERS := ${MYCODEDIR}/*.h

# make variables

CC        := g++
CXX       := g++
CCC       := g++
CPPFLAGS   = ${DEPENDFLAGS}
LOADLIBES := -lm -lmysqlclient
LDFLAGS   := -L/usr/lib/mysql


# This is what makemake added


# ../bin/bridge2.exe

../bin/bridge2.exe : ../common/stringone.o ../common/html_utils.o ../common/strings.o ../common/exception.o ../test/cgi/bridge2.o
	${LINKER} ${LDFLAGS} -o $@ ${filter-out %.a %.so, $^} ${LOADLIBES}


# ../bin/commesso.exe

../bin/commesso.exe : ../common/stringone.o ../common/html_utils.o ../common/strings.o ../common/exception.o ../test/cgi/commesso.o
	${LINKER} ${LDFLAGS} -o $@ ${filter-out %.a %.so, $^} ${LOADLIBES}


# ../bin/test2_cgi.exe

../bin/test2_cgi.exe : ../common/stringone.o ../common/strings.o ../common/exception.o ../test/cgi/test2_cgi.o
	${LINKER} ${LDFLAGS} -o $@ ${filter-out %.a %.so, $^} ${LOADLIBES}


# ../bin/test_cgi.exe

../bin/test_cgi.exe : ../test/cgi/test_cgi.o
	${LINKER} ${LDFLAGS} -o $@ ${filter-out %.a %.so, $^} ${LOADLIBES}


# ../bin/stypes

../bin/stypes : ../common/strings.o ../common/channel.o ../common/exception.o ../sql/sqltypes.o ../test/stypes/stypes.o
	${LINKER} ${LDFLAGS} -o $@ ${filter-out %.a %.so, $^} ${LOADLIBES}


# ../bin/server

../bin/server : ../common/strings.o ../common/channel.o ../common/exception.o ../sql/sqltypes.o ../test/tcp/server.o
	${LINKER} ${LDFLAGS} -o $@ ${filter-out %.a %.so, $^} ${LOADLIBES}


# ../bin/client

../bin/client : ../common/strings.o ../common/channel.o ../common/exception.o ../sql/sqltypes.o ../test/tcp/client.o
	${LINKER} ${LDFLAGS} -o $@ ${filter-out %.a %.so, $^} ${LOADLIBES}


# ../bin/sqltest

../bin/sqltest : ../common/strings.o ../common/channel.o ../common/exception.o ../sql/sqltypes.o ../sql/sqlconnection.o ../test/sql/sql.o
	${LINKER} ${LDFLAGS} -o $@ ${filter-out %.a %.so, $^} ${LOADLIBES}


# target for making everything

.PHONY : all
all: ../bin/bridge2.exe ../bin/commesso.exe ../bin/test2_cgi.exe ../bin/test_cgi.exe ../bin/stypes ../bin/server ../bin/client ../bin/sqltest


# target for removing all object files

.PHONY : tidy
tidy::
	@${RM} core ../test/cgi/bridge2.o ../common/channel.o ../test/tcp/client.o ../test/cgi/commesso.o ../common/exception.o ../common/html_utils.o ../test/tcp/server.o ../test/sql/sql.o ../sql/sqlconnection.o ../sql/sqltypes.o ../common/stringone.o ../common/strings.o ../test/stypes/stypes.o ../test/cgi/test2_cgi.o ../test/cgi/test_cgi.o

# target for removing all object files

.PHONY : clean
clean:: tidy
	@${RM} ../bin/bridge2.exe ../bin/commesso.exe ../bin/test2_cgi.exe ../bin/test_cgi.exe ../bin/stypes ../bin/server ../bin/client ../bin/sqltest

# list of all source files

MM_ALL_SOURCES := ../test/cgi/bridge2.cc ../common/channel.cc ../test/tcp/client.cc ../test/cgi/commesso.cc ../common/exception.cc ../common/html_utils.cc ../test/tcp/server.cc ../test/sql/sql.cc ../sql/sqlconnection.cc ../sql/sqltypes.cc ../common/stringone.cc ../common/strings.cc ../test/stypes/stypes.cc ../test/cgi/test2_cgi.cc ../test/cgi/test_cgi.cc


# target for checking a source file

CHECKSYNTAXFILE := ${basename ${filter %${CHECKSTRING}, ${MM_ALL_SOURCES}}}

.PHONY : checksyntax
checksyntax:
  ifneq (${CHECKSYNTAXFILE},)
	@${MAKE} ${addsuffix .o, ${CHECKSYNTAXFILE}}
  else
	@echo No target to make ${CHECKSTRING}
  endif


# target for touching appropriate source files

.PHONY : touch
touch:
	@echo
	@echo Please ignore \"file arguments missing\" errors
	@echo
	@echo   `grep -l ${TOUCHSTRING} ${MM_ALL_SOURCES}`
	@-touch `grep -l ${TOUCHSTRING} ${MM_ALL_SOURCES}`
	@echo
	@echo   `grep -l ${TOUCHSTRING} ${TOUCHHEADERS}`
	@-touch `grep -l ${TOUCHSTRING} ${TOUCHHEADERS}`


# target for calculating dependencies

.PHONY : jdepend
jdepend:
	@makemake -depend Makefile -- ${DEPENDFLAGS} -- ../test/cgi/bridge2.cc ../test/cgi/bridge2.o ../common/channel.cc ../common/channel.o ../test/tcp/client.cc ../test/tcp/client.o ../test/cgi/commesso.cc ../test/cgi/commesso.o ../common/exception.cc ../common/exception.o ../common/html_utils.cc ../common/html_utils.o ../test/tcp/server.cc ../test/tcp/server.o ../test/sql/sql.cc ../test/sql/sql.o ../sql/sqlconnection.cc ../sql/sqlconnection.o ../sql/sqltypes.cc ../sql/sqltypes.o ../common/stringone.cc ../common/stringone.o ../common/strings.cc ../common/strings.o ../test/stypes/stypes.cc ../test/stypes/stypes.o ../test/cgi/test2_cgi.cc ../test/cgi/test2_cgi.o ../test/cgi/test_cgi.cc ../test/cgi/test_cgi.o


# DO NOT DELETE THIS LINE -- makemake depends on it.

../test/cgi/bridge2.o: ../common/html_utils.h ../common/stringone.h /usr/include/stdio.h /usr/include/stdlib.h /usr/include/string.h

../common/channel.o: ../common/channel.h ../common/exception.h ../common/strings.h /usr/include/arpa/inet.h /usr/include/fcntl.h /usr/include/netdb.h /usr/include/netinet/in.h /usr/include/stdio.h /usr/include/string.h /usr/include/sys/socket.h /usr/include/sys/stat.h /usr/include/sys/time.h /usr/include/sys/types.h /usr/include/unistd.h

../test/tcp/client.o: ../common/channel.h ../common/exception.h ../common/strings.h /usr/include/arpa/inet.h /usr/include/netdb.h /usr/include/netinet/in.h /usr/include/string.h /usr/include/sys/socket.h /usr/include/sys/time.h /usr/include/sys/types.h /usr/include/unistd.h

../test/cgi/commesso.o: ../common/html_utils.h ../common/stringone.h /usr/include/stdio.h /usr/include/stdlib.h /usr/include/string.h

../common/exception.o: ../common/exception.h ../common/strings.h /usr/include/string.h

../common/html_utils.o: ../common/html_utils.h /usr/include/stdio.h /usr/include/stdlib.h /usr/include/string.h

../test/tcp/server.o: ../common/channel.h ../common/exception.h ../common/strings.h /usr/include/arpa/inet.h /usr/include/netdb.h /usr/include/netinet/in.h /usr/include/string.h /usr/include/sys/socket.h /usr/include/sys/time.h /usr/include/sys/types.h /usr/include/unistd.h

../test/sql/sql.o: ../common/exception.h ../common/strings.h ../sql/sqlconnection.h ../sql/sqltypes.h /usr/include/mysql/mysql.h /usr/include/string.h

../sql/sqlconnection.o: ../common/exception.h ../common/strings.h ../sql/sqlconnection.h ../sql/sqltypes.h /usr/include/mysql/mysql.h /usr/include/stdlib.h /usr/include/string.h

../sql/sqltypes.o: ../common/exception.h ../common/strings.h ../sql/sqltypes.h /usr/include/mysql/mysql.h /usr/include/stdio.h /usr/include/string.h

../common/stringone.o: ../common/stringone.h /usr/include/stdlib.h /usr/include/string.h

../common/strings.o: ../common/exception.h ../common/strings.h /usr/include/errno.h /usr/include/stdio.h /usr/include/stdlib.h /usr/include/string.h

../test/stypes/stypes.o: ../common/exception.h ../common/strings.h ../sql/sqltypes.h /usr/include/mysql/mysql.h /usr/include/string.h

../test/cgi/test2_cgi.o: ../common/stringone.h /usr/include/stdio.h /usr/include/stdlib.h /usr/include/string.h

../test/cgi/test_cgi.o: /usr/include/math.h /usr/include/stdio.h /usr/include/stdlib.h /usr/include/string.h

