]> code.citadel.org Git - citadel.git/commitdiff
Better Makefile
authorArt Cancro <ajc@citadel.org>
Fri, 2 Apr 1999 03:31:37 +0000 (03:31 +0000)
committerArt Cancro <ajc@citadel.org>
Fri, 2 Apr 1999 03:31:37 +0000 (03:31 +0000)
got initial room read running

daphne/Makefile
daphne/citclient.cpp
daphne/roomview.cpp

index 064df364216a1c0f4922dc90f45bd58371f7ab26..6c072f6854f82c85d452ad7e0579a5d5d8bdff13 100644 (file)
@@ -1,6 +1,14 @@
 CFLAGS=`wx-config --cflags`
 LFLAGS=`wx-config --libs`
 
+all: daphne
+
+.SUFFIXES: .cpp .o .hpp
+
+.cpp.o:
+       c++ $(CFLAGS) -c $<
+
+
 daphne: main.o citclient.o userlogin.o testwindow.o who.o \
        utils.o express_message.o send_express.o \
        roomtree.o roomview.o tcp_sockets.o
@@ -9,35 +17,5 @@ daphne: main.o citclient.o userlogin.o testwindow.o who.o \
        roomtree.o roomview.o tcp_sockets.o \
        $(LFLAGS) -o daphne
 
-main.o: main.cpp includes.hpp
-       c++ -c $(CFLAGS) main.cpp
-
-citclient.o: citclient.cpp includes.hpp
-       c++ -c $(CFLAGS) citclient.cpp
-
-userlogin.o: userlogin.cpp includes.hpp
-       c++ -c $(CFLAGS) userlogin.cpp
-
-testwindow.o: testwindow.cpp includes.hpp
-       c++ -c $(CFLAGS) testwindow.cpp
-
-who.o: who.cpp includes.hpp
-       c++ -c $(CFLAGS) who.cpp
-
-utils.o: utils.cpp includes.hpp
-       c++ -c $(CFLAGS) utils.cpp
-
-express_message.o: express_message.cpp includes.hpp
-       c++ -c $(CFLAGS) express_message.cpp
-
-send_express.o: send_express.cpp includes.hpp
-       c++ -c $(CFLAGS) send_express.cpp
-
-roomtree.o: roomtree.cpp includes.hpp
-       c++ -c $(CFLAGS) roomtree.cpp
-
-roomview.o: roomview.cpp includes.hpp
-       c++ -c $(CFLAGS) roomview.cpp
-
-tcp_sockets.o: tcp_sockets.cpp includes.hpp
-       c++ -c $(CFLAGS) tcp_sockets.cpp
+clean:
+       rm -f *.o core daphne
index 2b7b4b7f748aedd12c7c4ef125b0e7003501892e..addfd1d4b07414569af3dde71e31d757d284a8b0 100644 (file)
@@ -99,8 +99,10 @@ int CitClient::serv_trans(
        // If a mutex is to be wrapped around this function in the future,
        // it must begin HERE.
 
+       cout << "<" << command << "\n" ;
        serv_puts(command);
        serv_gets(response);
+       cout << ">" << response << "\n" ;
        first_digit = (response.GetChar(0)) - '0';
 
        if (response.GetChar(3) == '*')
index 081c9099a7568c8cec5b76dab3d79b9d8b574112..24f9522124213eafc2c5337c4badcc7052e4d83f 100644 (file)
@@ -103,8 +103,8 @@ void RoomView::OnButtonPressed(wxCommandEvent& whichbutton) {
 
 void RoomView::do_readloop(wxString readcmd) {
        wxString sendcmd, recvcmd, buf;
-       wxStringList xferbuf;
-        int i;
+       wxStringList xferbuf, msgbuf;
+        int i, r;
        
        if (message_window != NULL) {
                delete message_window;
@@ -145,15 +145,12 @@ void RoomView::do_readloop(wxString readcmd) {
         for (i=0; i<xferbuf.Number(); ++i) {
                 buf.Printf("%s", (wxString *)xferbuf.Nth(i)->GetData());
                sendcmd = "MSG0 " + buf;
-               cout << "Sending cmd: <" << sendcmd << ">\n";
-               i = citsock->serv_trans(sendcmd, recvcmd, xferbuf, ThisRoom);
-               cout << "return code " << i << "\n";
-               if (i == 1) {
-                       ListToMultiline(buf, xferbuf);
+               r = citsock->serv_trans(sendcmd, recvcmd, msgbuf, ThisRoom);
+               if (r == 1) {
+                       ListToMultiline(buf, msgbuf);
                        message_window->WriteText(buf);
                        message_window->WriteText("\n\n");
                }
-               cout << "done outputttting\n";
         }
 }