diff --git a/configure.ac b/configure.ac index f14095c..ece1ff1 100644 --- a/configure.ac +++ b/configure.ac @@ -6,7 +6,7 @@ AC_INIT(mosh, 0.9, mosh-devel@mit.edu) AM_INIT_AUTOMAKE(mosh, 0.9) AC_CONFIG_SRCDIR([src/frontend/mosh-client.cc]) AC_CONFIG_HEADERS([config.h]) -AC_OUTPUT(Makefile src/Makefile src/crypto/Makefile src/frontend/Makefile src/network/Makefile src/protobufs/Makefile src/statesync/Makefile src/terminal/Makefile src/util/Makefile scripts/Makefile) +AC_OUTPUT(Makefile src/Makefile src/crypto/Makefile src/frontend/Makefile src/network/Makefile src/protobufs/Makefile src/statesync/Makefile src/terminal/Makefile src/util/Makefile scripts/Makefile src/examples/Makefile) # Checks for programs. AC_PROG_CXX diff --git a/src/Makefile.am b/src/Makefile.am index 409dac9..f924ab0 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -1 +1 @@ -SUBDIRS = protobufs util crypto terminal network statesync frontend +SUBDIRS = protobufs util crypto terminal network statesync frontend examples diff --git a/src/examples/Makefile.am b/src/examples/Makefile.am new file mode 100644 index 0000000..9c6ca1c --- /dev/null +++ b/src/examples/Makefile.am @@ -0,0 +1,25 @@ +AM_CXXFLAGS = --std=c++0x -pedantic -Werror -Wall -Wextra -Weffc++ -fno-default-inline -pipe + +noinst_PROGRAMS = encrypt decrypt ntester parse termemu + +LIBS = `pkg-config --libs protobuf-lite` + +encrypt_SOURCES = encrypt.cc +encrypt_CPPFLAGS = -I$(srcdir)/../crypto +encrypt_LDADD = ../crypto/libmoshcrypto.a + +decrypt_SOURCES = decrypt.cc +decrypt_CPPFLAGS = -I$(srcdir)/../crypto +decrypt_LDADD = ../crypto/libmoshcrypto.a + +parse_SOURCES = parse.cc +parse_CPPFLAGS = -I$(srcdir)/../terminal -I$(srcdir)/../util +parse_LDADD = ../terminal/libmoshterminal.a ../util/libmoshutil.a -lutil + +termemu_SOURCES = termemu.cc +termemu_CPPFLAGS = -I$(srcdir)/../terminal -I$(srcdir)/../util -I$(srcdir)/../statesync -I$(builddir)/../protobufs +termemu_LDADD = ../terminal/libmoshterminal.a ../util/libmoshutil.a ../statesync/libmoshstatesync.a ../protobufs/libmoshprotos.a -lutil + +ntester_SOURCES = ntester.cc +ntester_CPPFLAGS = -I$(srcdir)/../statesync -I$(srcdir)/../terminal -I$(srcdir)/../network -I$(srcdir)/../crypto -I$(builddir)/../protobufs +ntester_LDADD = ../statesync/libmoshstatesync.a ../terminal/libmoshterminal.a ../network/libmoshnetwork.a ../crypto/libmoshcrypto.a ../protobufs/libmoshprotos.a -lutil -lrt -lm diff --git a/examples/decrypt.cpp b/src/examples/decrypt.cc similarity index 98% rename from examples/decrypt.cpp rename to src/examples/decrypt.cc index c649d0d..0b65f2b 100644 --- a/examples/decrypt.cpp +++ b/src/examples/decrypt.cc @@ -6,7 +6,7 @@ #include #include -#include "crypto.hpp" +#include "crypto.h" using namespace Crypto; diff --git a/examples/encrypt.cpp b/src/examples/encrypt.cc similarity index 98% rename from examples/encrypt.cpp rename to src/examples/encrypt.cc index c6b70e8..c84934e 100644 --- a/examples/encrypt.cpp +++ b/src/examples/encrypt.cc @@ -6,7 +6,7 @@ #include #include -#include "crypto.hpp" +#include "crypto.h" using namespace Crypto; diff --git a/examples/ntester.cpp b/src/examples/ntester.cc similarity index 98% rename from examples/ntester.cpp rename to src/examples/ntester.cc index 63f7f3f..7885538 100644 --- a/examples/ntester.cpp +++ b/src/examples/ntester.cc @@ -2,8 +2,8 @@ #include #include -#include "user.hpp" -#include "networktransport.cpp" +#include "user.h" +#include "networktransport.cc" using namespace Network; diff --git a/examples/parse.cpp b/src/examples/parse.cc similarity index 98% rename from examples/parse.cpp rename to src/examples/parse.cc index db73bd9..62a1177 100644 --- a/examples/parse.cpp +++ b/src/examples/parse.cc @@ -14,8 +14,8 @@ #include #include -#include "parser.hpp" -#include "swrite.hpp" +#include "parser.h" +#include "swrite.h" const size_t buf_size = 1024; diff --git a/examples/termemu.cpp b/src/examples/termemu.cc similarity index 98% rename from examples/termemu.cpp rename to src/examples/termemu.cc index b4b2736..de3ec8d 100644 --- a/examples/termemu.cpp +++ b/src/examples/termemu.cc @@ -21,9 +21,9 @@ #include #include -#include "parser.hpp" -#include "completeterminal.hpp" -#include "swrite.hpp" +#include "parser.h" +#include "completeterminal.h" +#include "swrite.h" const size_t buf_size = 16384;