JFLAGS = -g -cp ./client/:./server/
JC = javac
JVM= java
JDC=javadoc

.SUFFIXES: .java .class .html
.java.class:
	$(JC) $(JFLAGS) $*.java

CLIENT_CLASSES = \
        ./client/ChatClient.java \
        ./client/clientPane.java \
        ./client/sendListener.java

SERVER_CLASSES = \
        ./server/ChatServer.java \
        ./server/clientData.java \
        ./server/serverPane.java \
        ./server/serverThread.java


default: client \
         server

client: $(CLIENT_CLASSES:.java=.class)

server: $(SERVER_CLASSES:.java=.class)

doc: client_doc \
     server_doc

client_doc: $(CLIENT_CLASSES)
	$(JDC) -d client_doc ./client/*.java

server_doc: $(SERVER_CLASSES)
	$(JDC) -d server_doc ./server/*.java

clean:
	rm -f ./server/*.class
	rm -f ./client/*.class
	rm -f -r ./client_doc/
	rm -f -r ./server_doc/
