Index: meson/part/exports/meson.build
===================================================================
--- meson/part/exports/meson.build	(revision e3737eda150b91a6e642544af9d8cb1c8405b396)
+++ meson/part/exports/meson.build	(revision 77496465c8786f3a56518a8691172796a9aeab24)
@@ -9,5 +9,5 @@
 
 export_cppflags = [
-	'-isystem', '$(HELENOS_EXPORT_ROOT)/include/posix',
+	'-isystem', '$(HELENOS_EXPORT_ROOT)/include/libposix',
 	'-isystem', '$(HELENOS_EXPORT_ROOT)/include/libc',
 	'-idirafter', '$(HELENOS_EXPORT_ROOT)/include',
@@ -56,7 +56,2 @@
 	capture: true,
 )
-
-install_files += [[ 'config', meson.current_build_dir() / 'config.mk', 'config.mk' ]]
-install_deps += [ config_mk ]
-install_files += [[ 'config', meson.current_build_dir() / 'config.sh', 'config.sh' ]]
-install_deps += [ config_sh ]
Index: meson/part/initrd/install_devel.sh.in
===================================================================
--- meson/part/initrd/install_devel.sh.in	(revision 77496465c8786f3a56518a8691172796a9aeab24)
+++ meson/part/initrd/install_devel.sh.in	(revision 77496465c8786f3a56518a8691172796a9aeab24)
@@ -0,0 +1,9 @@
+#!/bin/sh
+
+if [ "$#" -ge 1 ]; then
+	DESTDIR="$1"
+else
+	DESTDIR="${MESON_INSTALL_DESTDIR_PREFIX}"
+fi
+
+@text@
Index: meson/part/initrd/meson.build
===================================================================
--- meson/part/initrd/meson.build	(revision e3737eda150b91a6e642544af9d8cb1c8405b396)
+++ meson/part/initrd/meson.build	(revision 77496465c8786f3a56518a8691172796a9aeab24)
@@ -31,4 +31,14 @@
 endforeach
 
+if CONFIG_DEVEL_FILES
+	install_script_text += uspace_lib_devel_install_script_text
+endif
+
+install_devel_script = configure_file(
+	configuration: { 'text' : '\n'.join(uspace_lib_devel_install_script_text) },
+	input: 'install_devel.sh.in',
+	output: 'install_devel.sh',
+)
+
 install_script_text += uspace_lib_install_script_text
 
@@ -42,4 +52,8 @@
 
 dist_dir = meson.build_root() / 'dist/'
+
+run_target('devel-headers',
+	command: [ sh, install_devel_script, dist_dir ],
+)
 
 dist = custom_target('DIST',
Index: tools/README
===================================================================
--- tools/README	(revision 77496465c8786f3a56518a8691172796a9aeab24)
+++ tools/README	(revision 77496465c8786f3a56518a8691172796a9aeab24)
@@ -0,0 +1,63 @@
+## Tools
+
+This directory contains various scripts.
+Some of them are used by the build system itself and are not relevant for most
+people. Others are available for manual use, and that category further
+divides into those meant to be used in the source directory, and those that
+work on the build directory.
+
+
+### Source directory scripts
+
+ * build_all.sh
+   - Builds (or incrementally rebuilds) all predefined HelenOS configurations.
+     Can be executed in arbitrary directory outside the source tree.
+ * build-ccheck.sh
+   - Builds the ccheck tool.
+ * ccheck.sh
+   - Runs the ccheck tool to verify coding style of C files in the repository.
+ * dest_build.py
+   - Legacy tool for out-of-tree build of the old Makefile-based source tree. Obsoleted by Meson.
+ * srepl
+   - A refactoring tool for global search-and-replace operations. Sed wrapper.
+ * toolchain.sh
+   - Builds the cross-compiler toolchains necessary to build HelenOS.
+ * release.sh
+   - Builds everything (as in build_all.sh), and generates release artifacts.
+
+
+### Build directory scripts
+
+ * ew.py
+   - Emulator Wrapper. After building the system image, some machines can be
+     run in an emulator, mostly QEMU. This script simplifies it.
+ * export.sh
+   - Exports a subset of development files in a form suitable for cross-compiling
+     third-party software independently of the HelenOS source tree.
+     The exported files are specific for the currently built configuration.
+
+
+### Used by build scripts
+
+ * autocheck.awk
+ * cc.sh
+ * config.py
+ * mkarray.py, mkarray_for_meson.sh
+ * mkuimage.py
+
+
+### Misc
+
+ * filldir.py
+   - Fill a directory with N empty directories. Seems to be unused, purpose unclear.
+ * gentestfile.py
+   - Generates test file for uspace/app/testread.
+ * jobfile.py
+   - Obsolete tooling support. Replaced by Meson.
+ * mkext2.py, mkext4.py, mkfat.py
+   - File system builders that don't require root privileges.
+     Used by build scripts and by ew.py.
+ * travis.sh
+   - Runs Travis CI jobs. Not meant for human consumption.
+ * imgutil.py, xstruct.py, xtui.py
+   - Libraries for other python scripts.
Index: tools/export.sh
===================================================================
--- tools/export.sh	(revision 77496465c8786f3a56518a8691172796a9aeab24)
+++ tools/export.sh	(revision 77496465c8786f3a56518a8691172796a9aeab24)
@@ -0,0 +1,38 @@
+#!/bin/sh
+
+if [ "$#" -ne 1 ]; then
+	echo "Must define export directory."
+	exit 1
+fi
+
+EXPORT_DIR="$1"
+
+# Only (re)build files we actually want to export.
+
+EXPORT_LIBS=" \
+	uspace/lib/libmath.a \
+	uspace/lib/libclui.a \
+	uspace/lib/libgui.a \
+	uspace/lib/libdraw.a \
+	uspace/lib/libsoftrend.a \
+	uspace/lib/libhound.a \
+	uspace/lib/libpcm.a \
+	uspace/lib/libcpp.a \
+	uspace/lib/libc.a \
+	uspace/lib/c/libstartfiles.a \
+	uspace/lib/libposix.a \
+"
+
+EXPORT_CONFIGS=" \
+	meson/part/exports/config.mk \
+	meson/part/exports/config.sh \
+"
+
+ninja $EXPORT_LIBS $EXPORT_CONFIGS
+ninja devel-headers
+
+mkdir -p "$EXPORT_DIR/lib"
+cp -t "$EXPORT_DIR/lib" $EXPORT_LIBS
+rm -rf "$EXPORT_DIR/include"
+cp -R dist/include "$EXPORT_DIR/include"
+cp -t "$EXPORT_DIR" $EXPORT_CONFIGS
Index: uspace/lib/c/meson.build
===================================================================
--- uspace/lib/c/meson.build	(revision e3737eda150b91a6e642544af9d8cb1c8405b396)
+++ uspace/lib/c/meson.build	(revision 77496465c8786f3a56518a8691172796a9aeab24)
@@ -21,12 +21,9 @@
 #        we should instead move the duplicated library parts into a shared location.
 
-if CONFIG_DEVEL_FILES
-	uspace_lib_install_script_text += 'mkdir -p "${DESTDIR}include/libc"'
-
-	foreach idir : incdirs
-		_sdir = meson.current_source_dir() / idir
-		uspace_lib_install_script_text += 'cp -R -L -T "@0@" "${DESTDIR}include/libc"'.format(_sdir)
-	endforeach
-endif
+uspace_lib_devel_install_script_text += 'mkdir -p "${DESTDIR}include/libc"'
+foreach idir : incdirs
+	_sdir = meson.current_source_dir() / idir
+	uspace_lib_devel_install_script_text += 'cp -R -L -T "@0@" "${DESTDIR}include/libc"'.format(_sdir)
+endforeach
 
 src = [ arch_src ]
Index: uspace/lib/meson.build
===================================================================
--- uspace/lib/meson.build	(revision e3737eda150b91a6e642544af9d8cb1c8405b396)
+++ uspace/lib/meson.build	(revision 77496465c8786f3a56518a8691172796a9aeab24)
@@ -64,5 +64,5 @@
 
 # Text of the install script.
-uspace_lib_install_script_text = []
+uspace_lib_devel_install_script_text = []
 
 foreach l : libs
@@ -121,15 +121,15 @@
 			includes += include_directories(incdir)
 
-			if CONFIG_DEVEL_FILES and installed_libs.contains(l)
+			if installed_libs.contains(l)
 				_sdir = meson.current_source_dir() / l / 'include'
-				uspace_lib_install_script_text += 'cp -R -L -T "@0@" "${DESTDIR}include/lib@1@"'.format(_sdir, l)
+				uspace_lib_devel_install_script_text += 'cp -R -L -T "@0@" "${DESTDIR}include/lib@1@"'.format(_sdir, l)
 			endif
 		else
 			includes += include_directories(l)
 
-			if CONFIG_DEVEL_FILES and installed_libs.contains(l)
+			if installed_libs.contains(l)
 				_sdir = meson.current_source_dir() / l
-				uspace_lib_install_script_text += 'mkdir -p "${DESTDIR}include/lib@0@"'.format(l)
-				uspace_lib_install_script_text += 'cp -L -t "${DESTDIR}include/lib@0@" "@1@"/*.h || true'.format(l, _sdir)
+				uspace_lib_devel_install_script_text += 'mkdir -p "${DESTDIR}include/lib@0@"'.format(l)
+				uspace_lib_devel_install_script_text += 'cp -L -t "${DESTDIR}include/lib@0@" "@1@"/*.h || true'.format(l, _sdir)
 			endif
 		endif
Index: uspace/lib/posix/meson.build
===================================================================
--- uspace/lib/posix/meson.build	(revision e3737eda150b91a6e642544af9d8cb1c8405b396)
+++ uspace/lib/posix/meson.build	(revision 77496465c8786f3a56518a8691172796a9aeab24)
@@ -34,3 +34,7 @@
 )
 
+_sdir = meson.current_source_dir() / 'include' / 'posix'
+uspace_lib_devel_install_script_text += 'mkdir -p "${DESTDIR}include/libposix"'
+uspace_lib_devel_install_script_text += 'cp -R -L -T "@0@" "${DESTDIR}include/libposix"'.format(_sdir)
+
 # TODO: exports
