diff --git a/Makefile.tools b/Makefile.tools
index 9647fb0..42c1f27 100644
--- a/Makefile.tools
+++ b/Makefile.tools
@GLIB_LIBS@ @DBUS_LIBS@ -lreadline
endif
-if MESH
-bin_PROGRAMS += mesh/meshctl
-
-mesh_meshctl_SOURCES = mesh/main.c \
- mesh/mesh-net.h \
- mesh/node.h mesh/node.c \
- mesh/gatt.h mesh/gatt.c \
- mesh/crypto.h mesh/crypto.c \
- mesh/keys.h \
- mesh/net.h mesh/net.c \
- mesh/prov.h mesh/prov.c \
- mesh/util.h mesh/util.c \
- mesh/agent.h mesh/agent.c \
- mesh/prov-db.h mesh/prov-db.c \
- mesh/config-model.h mesh/config-client.c \
- mesh/config-server.c \
- mesh/onoff-model.h mesh/onoff-model.c
-mesh_meshctl_LDADD = gdbus/libgdbus-internal.la src/libshared-glib.la \
- lib/libbluetooth-internal.la \
- @GLIB_LIBS@ @DBUS_LIBS@ -ljson-c -lreadline
-endif
-
-EXTRA_DIST += mesh/local_node.json mesh/prov_db.json
-
if MONITOR
bin_PROGRAMS += monitor/btmon
EXTRA_DIST += tools/bdaddr.1
+if MESH
+bin_PROGRAMS += tools/meshctl
+
+tools_meshctl_SOURCES = tools/meshctl.c \
+ mesh/mesh-net.h \
+ mesh/node.h mesh/node.c \
+ mesh/gatt.h mesh/gatt.c \
+ mesh/crypto.h mesh/crypto.c \
+ mesh/keys.h \
+ mesh/net.h mesh/net.c \
+ mesh/prov.h mesh/prov.c \
+ mesh/util.h mesh/util.c \
+ mesh/agent.h mesh/agent.c \
+ mesh/prov-db.h mesh/prov-db.c \
+ mesh/config-model.h mesh/config-client.c \
+ mesh/config-server.c \
+ mesh/onoff-model.h mesh/onoff-model.c
+tools_meshctl_LDADD = gdbus/libgdbus-internal.la src/libshared-glib.la \
+ lib/libbluetooth-internal.la \
+ @GLIB_LIBS@ @DBUS_LIBS@ -ljson-c -lreadline
+endif
+
+EXTRA_DIST += mesh/local_node.json mesh/prov_db.json
+
if DEPRECATED
bin_PROGRAMS += tools/hciattach tools/hciconfig tools/hcitool tools/hcidump \
tools/rfcomm tools/sdptool tools/ciptool
diff --git a/mesh/main.c b/tools/meshctl.c
similarity index 100%
rename from mesh/main.c
rename to tools/meshctl.c