diff --git a/Makefile b/Makefile index 06e4943d..c89c39e7 100644 --- a/Makefile +++ b/Makefile @@ -11,7 +11,10 @@ SUBDIRS = \ io \ net \ synergy \ + client \ + server \ $(NULL) + # # targets # diff --git a/synergy/CClient.cpp b/client/CClient.cpp similarity index 100% rename from synergy/CClient.cpp rename to client/CClient.cpp diff --git a/synergy/CClient.h b/client/CClient.h similarity index 100% rename from synergy/CClient.h rename to client/CClient.h diff --git a/synergy/CXWindowsSecondaryScreen.cpp b/client/CXWindowsSecondaryScreen.cpp similarity index 100% rename from synergy/CXWindowsSecondaryScreen.cpp rename to client/CXWindowsSecondaryScreen.cpp diff --git a/synergy/CXWindowsSecondaryScreen.h b/client/CXWindowsSecondaryScreen.h similarity index 100% rename from synergy/CXWindowsSecondaryScreen.h rename to client/CXWindowsSecondaryScreen.h diff --git a/client/Makefile b/client/Makefile new file mode 100644 index 00000000..6c0b49cd --- /dev/null +++ b/client/Makefile @@ -0,0 +1,44 @@ +DEPTH=.. +include $(DEPTH)/Makecommon + +# +# target file +# +TARGET = client + +# +# source files +# +LCXXINCS = \ + -I$(DEPTH)/base \ + -I$(DEPTH)/mt \ + -I$(DEPTH)/io \ + -I$(DEPTH)/net \ + -I$(DEPTH)/synergy \ + $(NULL) +CXXFILES = \ + CXWindowsSecondaryScreen.cpp \ + CClient.cpp \ + client.cpp \ + $(NULL) + +# +# libraries we depend on +# +DEPLIBS = \ + $(LIBDIR)/libsynergy.a \ + $(LIBDIR)/libnet.a \ + $(LIBDIR)/libio.a \ + $(LIBDIR)/libmt.a \ + $(LIBDIR)/libbase.a \ + $(NULL) +LLDLIBS = \ + $(DEPLIBS) \ + -lpthread \ + $(NULL) + +targets: $(TARGET) + +$(TARGET): $(OBJECTS) $(DEPLIBS) + $(CXX) $(CXXFLAGS) -o $@ $(OBJECTS) $(LDFLAGS) + diff --git a/synergy/client.cpp b/client/client.cpp similarity index 100% rename from synergy/client.cpp rename to client/client.cpp diff --git a/synergy/CScreenMap.cpp b/server/CScreenMap.cpp similarity index 100% rename from synergy/CScreenMap.cpp rename to server/CScreenMap.cpp diff --git a/synergy/CScreenMap.h b/server/CScreenMap.h similarity index 100% rename from synergy/CScreenMap.h rename to server/CScreenMap.h diff --git a/synergy/CServer.cpp b/server/CServer.cpp similarity index 100% rename from synergy/CServer.cpp rename to server/CServer.cpp diff --git a/synergy/CServer.h b/server/CServer.h similarity index 100% rename from synergy/CServer.h rename to server/CServer.h diff --git a/synergy/CServerProtocol.cpp b/server/CServerProtocol.cpp similarity index 100% rename from synergy/CServerProtocol.cpp rename to server/CServerProtocol.cpp diff --git a/synergy/CServerProtocol.h b/server/CServerProtocol.h similarity index 100% rename from synergy/CServerProtocol.h rename to server/CServerProtocol.h diff --git a/synergy/CServerProtocol1_0.cpp b/server/CServerProtocol1_0.cpp similarity index 100% rename from synergy/CServerProtocol1_0.cpp rename to server/CServerProtocol1_0.cpp diff --git a/synergy/CServerProtocol1_0.h b/server/CServerProtocol1_0.h similarity index 100% rename from synergy/CServerProtocol1_0.h rename to server/CServerProtocol1_0.h diff --git a/synergy/CXWindowsPrimaryScreen.cpp b/server/CXWindowsPrimaryScreen.cpp similarity index 100% rename from synergy/CXWindowsPrimaryScreen.cpp rename to server/CXWindowsPrimaryScreen.cpp diff --git a/synergy/CXWindowsPrimaryScreen.h b/server/CXWindowsPrimaryScreen.h similarity index 100% rename from synergy/CXWindowsPrimaryScreen.h rename to server/CXWindowsPrimaryScreen.h diff --git a/server/Makefile b/server/Makefile new file mode 100644 index 00000000..2ff1150f --- /dev/null +++ b/server/Makefile @@ -0,0 +1,47 @@ +DEPTH=.. +include $(DEPTH)/Makecommon + +# +# target file +# +TARGET = server + +# +# source files +# +LCXXINCS = \ + -I$(DEPTH)/base \ + -I$(DEPTH)/mt \ + -I$(DEPTH)/io \ + -I$(DEPTH)/net \ + -I$(DEPTH)/synergy \ + $(NULL) +CXXFILES = \ + CScreenMap.cpp \ + CServerProtocol.cpp \ + CServerProtocol1_0.cpp \ + CXWindowsPrimaryScreen.cpp \ + CServer.cpp \ + server.cpp \ + $(NULL) + +# +# libraries we depend on +# +DEPLIBS = \ + $(LIBDIR)/libsynergy.a \ + $(LIBDIR)/libnet.a \ + $(LIBDIR)/libio.a \ + $(LIBDIR)/libmt.a \ + $(LIBDIR)/libbase.a \ + $(NULL) +LLDLIBS = \ + $(DEPLIBS) \ + -lpthread \ + $(NULL) + +targets: $(TARGET) + +$(TARGET): $(OBJECTS) $(DEPLIBS) + $(CXX) $(CXXFLAGS) -o $@ $(OBJECTS) $(LDFLAGS) + diff --git a/synergy/server.cpp b/server/server.cpp similarity index 100% rename from synergy/server.cpp rename to server/server.cpp diff --git a/synergy/Makefile b/synergy/Makefile index 15d806f4..bb557bf8 100644 --- a/synergy/Makefile +++ b/synergy/Makefile @@ -1,6 +1,11 @@ DEPTH=.. include $(DEPTH)/Makecommon +# +# target file +# +TARGET = synergy + # # source files # @@ -13,39 +18,16 @@ LCXXINCS = \ CXXFILES = \ CInputPacketStream.cpp \ COutputPacketStream.cpp \ - CTCPSocketFactory.cpp \ CProtocolUtil.cpp \ - CClient.cpp \ - CServerProtocol.cpp \ - CServerProtocol1_0.cpp \ - CScreenMap.cpp \ - CServer.cpp \ - CXWindowsScreen.cpp \ - CXWindowsPrimaryScreen.cpp \ - CXWindowsSecondaryScreen.cpp \ + CTCPSocketFactory.cpp \ CXWindowsClipboard.cpp \ + CXWindowsScreen.cpp \ XSynergy.cpp \ $(NULL) -# -# libraries we depend on -# -DEPLIBS = \ - $(LIBDIR)/libnet.a \ - $(LIBDIR)/libio.a \ - $(LIBDIR)/libmt.a \ - $(LIBDIR)/libbase.a \ - $(NULL) -LLDLIBS = \ - $(DEPLIBS) \ - -lpthread \ - $(NULL) +targets: $(LIBTARGET) -targets: server client - -server: server.o $(OBJECTS) $(DEPLIBS) - $(CXX) $(CXXFLAGS) -o $@ server.o $(OBJECTS) $(LDFLAGS) - -client: client.o $(OBJECTS) $(DEPLIBS) - $(CXX) $(CXXFLAGS) -o $@ client.o $(OBJECTS) $(LDFLAGS) +$(LIBTARGET): $(OBJECTS) + if test ! -d $(LIBDIR); then $(MKDIR) $(LIBDIR); fi + $(ARF) $(LIBTARGET) $(OBJECTS)