all: event2dot apache2events

OPTIONS=-O2 -g

apache2events: config.o apache2events.o 
	g++ $(OPTIONS) config.o apache2events.o -o apache2events
	cp apache2events ../bin

event2dot: binarytree.o readfile.o event2dot.o graph.o dotgen.o config.o
	g++ $(OPTIONS) binarytree.o dotgen.o readfile.o event2dot.o graph.o config.o -o event2dot
	cp event2dot ../bin

config.o: config.h config.cpp
	g++ $(OPTIONS) -c config.cpp -o config.o

readfile.o: graph.h readfile.h readfile.cpp
	g++ $(OPTIONS) -c readfile.cpp -o readfile.o

dotgen.o: graph.h dotgen.h dotgen.cpp
	g++ $(OPTIONS) -c dotgen.cpp -o dotgen.o

graph.o: graph.h graph.cpp
	g++ $(OPTIONS) -c graph.cpp -o graph.o

binarytree.o: binarytree.h binarytree.cpp
	g++ $(OPTIONS) -c binarytree.cpp -o binarytree.o

apache2events.o: apache2events.cpp 
	g++ $(OPTIONS) -c apache2events.cpp -o apache2events.o

event2dot.o: graph.h readfile.h event2dot.cpp
	g++ $(OPTIONS) -c event2dot.cpp -o event2dot.o

clean:
	rm *.o event2dot apache2events || true
