diff --git a/.gitignore b/.gitignore
index 31e4b606b..b3d60fac1 100644
--- a/.gitignore
+++ b/.gitignore
@@ -21,6 +21,7 @@ src/*.o
src/mtrace.txt
src/outbin
src/czmq_selftest
+doc/*.1
doc/*.3
doc/*.7
doc/*.xml
@@ -94,38 +95,16 @@ examples/zpubsub/zprototest/*.bnf
examples/zpubsub/zprototest/test_publisher
examples/zpubsub/zprototest/test_subscriber
src/test_zgossip
-labs/.deps/
-labs/.libs/
-labs/*.o
-labs/*.lo
-labs/*.pc
-
+.deps
+.libs
.cproject
.project
+.dirstamp
*~
-labs/*.lo
-labs/*.o
-labs/.deps/
-labs/.libs/
-labs/Makefile
-labs/Makefile.in
-labs/core
-labs/czmq_labs.la
-labs/czmq_labs_selftest
-labs/czmq_labs_selftest.log
-labs/czmq_labs_selftest.trs
-labs/libczmq_labs.pc
-labs/malloc.txt
-labs/mtrace.txt
-labs/outbin
-labs/test-suite.log
ChangeLog
.libs/
czmq_labs_selftest*
czmq_selftest*
makecert
test-suite.log
-addons/.dirstamp
-labs/.dirstamp
-src/.dirstamp
*.pyc
diff --git a/CMakeLists.txt b/CMakeLists.txt
index bce0a4d10..e13d27bfe 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -134,6 +134,11 @@ set (czmq_headers
src/zgossip_engine.inc
src/zhash_primes.inc
src/zclass_example.xml
+ src/foreign/sha1/sha1.inc_c
+ src/foreign/sha1/sha1.h
+ src/foreign/slre/slre.inc_c
+ src/foreign/slre/slre.h
+ src/foreign/slre/readme.txt
)
source_group ("Header Files" FILES ${czmq_headers})
install(FILES ${czmq_headers} DESTINATION include)
diff --git a/Makefile.am b/Makefile.am
index 1b7651e8f..8dba140c4 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -13,9 +13,10 @@ project_libs = \
${zmq_LIBS}
SUBDIRS =
+DIST_SUBDIRS =
SUBDIRS += doc
+DIST_SUBDIRS += doc
-DIST_SUBDIRS =
lib_LTLIBRARIES =
bin_PROGRAMS =
noinst_PROGRAMS =
@@ -27,6 +28,13 @@ EXTRA_DIST = \
src/zgossip_engine.inc \
src/zhash_primes.inc \
src/zclass_example.xml \
+ src/foreign/sha1/sha1.inc_c \
+ src/foreign/sha1/sha1.h \
+ src/foreign/slre/slre.inc_c \
+ src/foreign/slre/slre.h \
+ src/foreign/slre/readme.txt \
+ src/zgossip_msg.h \
+ src/czmq_classes.h \
version.sh
include $(srcdir)/src/Makemodule.am
diff --git a/builds/msvc/vs2008/czmq/czmq.vcproj b/builds/msvc/vs2008/czmq/czmq.vcproj
index 26d7cd9ef..df18742ab 100644
--- a/builds/msvc/vs2008/czmq/czmq.vcproj
+++ b/builds/msvc/vs2008/czmq/czmq.vcproj
@@ -1560,6 +1560,11 @@
+
+
+
+
+
diff --git a/builds/msvc/vs2010/czmq/czmq.vcxproj b/builds/msvc/vs2010/czmq/czmq.vcxproj
index 045558d28..d62dc0d09 100644
--- a/builds/msvc/vs2010/czmq/czmq.vcxproj
+++ b/builds/msvc/vs2010/czmq/czmq.vcxproj
@@ -83,6 +83,11 @@
+
+
+
+
+
diff --git a/builds/msvc/vs2010/czmq/czmq.vcxproj.filters b/builds/msvc/vs2010/czmq/czmq.vcxproj.filters
index d8a8aeaaf..5fb7a5068 100644
--- a/builds/msvc/vs2010/czmq/czmq.vcxproj.filters
+++ b/builds/msvc/vs2010/czmq/czmq.vcxproj.filters
@@ -150,6 +150,21 @@
src
+
+ src
+
+
+ src
+
+
+ src
+
+
+ src
+
+
+ src
+
diff --git a/builds/msvc/vs2012/czmq/czmq.vcxproj b/builds/msvc/vs2012/czmq/czmq.vcxproj
index c08bb4e6a..6993cb314 100644
--- a/builds/msvc/vs2012/czmq/czmq.vcxproj
+++ b/builds/msvc/vs2012/czmq/czmq.vcxproj
@@ -83,6 +83,11 @@
+
+
+
+
+
diff --git a/builds/msvc/vs2012/czmq/czmq.vcxproj.filters b/builds/msvc/vs2012/czmq/czmq.vcxproj.filters
index d8a8aeaaf..5fb7a5068 100644
--- a/builds/msvc/vs2012/czmq/czmq.vcxproj.filters
+++ b/builds/msvc/vs2012/czmq/czmq.vcxproj.filters
@@ -150,6 +150,21 @@
src
+
+ src
+
+
+ src
+
+
+ src
+
+
+ src
+
+
+ src
+
diff --git a/builds/msvc/vs2013/czmq/czmq.vcxproj b/builds/msvc/vs2013/czmq/czmq.vcxproj
index a3b0bb573..3e071c364 100644
--- a/builds/msvc/vs2013/czmq/czmq.vcxproj
+++ b/builds/msvc/vs2013/czmq/czmq.vcxproj
@@ -83,6 +83,11 @@
+
+
+
+
+
diff --git a/builds/msvc/vs2013/czmq/czmq.vcxproj.filters b/builds/msvc/vs2013/czmq/czmq.vcxproj.filters
index d8a8aeaaf..5fb7a5068 100644
--- a/builds/msvc/vs2013/czmq/czmq.vcxproj.filters
+++ b/builds/msvc/vs2013/czmq/czmq.vcxproj.filters
@@ -150,6 +150,21 @@
src
+
+ src
+
+
+ src
+
+
+ src
+
+
+ src
+
+
+ src
+
diff --git a/project.xml b/project.xml
index f626966ba..c29f39ca4 100644
--- a/project.xml
+++ b/project.xml
@@ -48,6 +48,11 @@
+
+
+
+
+
diff --git a/src/Makemodule.am b/src/Makemodule.am
index 5ffc964c2..d844d346d 100644
--- a/src/Makemodule.am
+++ b/src/Makemodule.am
@@ -105,6 +105,11 @@ src_libczmq_la_SOURCES = \
src/zgossip_engine.inc \
src/zhash_primes.inc \
src/zclass_example.xml \
+ src/foreign/sha1/sha1.inc_c \
+ src/foreign/sha1/sha1.h \
+ src/foreign/slre/slre.inc_c \
+ src/foreign/slre/slre.h \
+ src/foreign/slre/readme.txt \
src/platform.h
src_libczmq_la_CPPFLAGS = ${AM_CPPFLAGS}
diff --git a/foreign/sha1/sha1.h b/src/foreign/sha1/sha1.h
similarity index 100%
rename from foreign/sha1/sha1.h
rename to src/foreign/sha1/sha1.h
diff --git a/foreign/sha1/sha1.c b/src/foreign/sha1/sha1.inc_c
similarity index 99%
rename from foreign/sha1/sha1.c
rename to src/foreign/sha1/sha1.inc_c
index 2befaa73c..a3c699f21 100644
--- a/foreign/sha1/sha1.c
+++ b/src/foreign/sha1/sha1.inc_c
@@ -33,7 +33,7 @@
* implemented by Jun-ichiro itojun Itoh
*/
-#include "../../include/czmq.h"
+#include "../../../include/czmq.h"
#include "sha1.h"
/* constant table */
diff --git a/foreign/sha1/sha1.o b/src/foreign/sha1/sha1.o
similarity index 100%
rename from foreign/sha1/sha1.o
rename to src/foreign/sha1/sha1.o
diff --git a/foreign/slre/readme.txt b/src/foreign/slre/readme.txt
similarity index 100%
rename from foreign/slre/readme.txt
rename to src/foreign/slre/readme.txt
diff --git a/foreign/slre/slre.h b/src/foreign/slre/slre.h
similarity index 100%
rename from foreign/slre/slre.h
rename to src/foreign/slre/slre.h
diff --git a/foreign/slre/slre.c b/src/foreign/slre/slre.inc_c
similarity index 100%
rename from foreign/slre/slre.c
rename to src/foreign/slre/slre.inc_c
diff --git a/src/zdigest.c b/src/zdigest.c
index f914dc944..141468c0f 100644
--- a/src/zdigest.c
+++ b/src/zdigest.c
@@ -25,7 +25,7 @@
#include "platform.h"
#include "../include/czmq.h"
-#include "../foreign/sha1/sha1.c"
+#include "foreign/sha1/sha1.inc_c"
// Structure of our class
diff --git a/src/zrex.c b/src/zrex.c
index 8ef4274e1..7346b79eb 100644
--- a/src/zrex.c
+++ b/src/zrex.c
@@ -44,8 +44,7 @@
*/
#include "../include/czmq.h"
-#include "../foreign/slre/slre.h"
-#include "../foreign/slre/slre.c"
+#include "foreign/slre/slre.inc_c"
#define MAX_HITS 100 // Should be enough for anyone :)