diff --git a/build_all b/build_all
index 14faf2b77ecd833dceccf800c16caed4c6d30c69..e808aae27ae063f8a34a53fa7f06f694716cb2d3 100755
--- a/build_all
+++ b/build_all
@@ -2,6 +2,6 @@
 
 chmod o-rwx $(dirname $0)
 make -C $(dirname $0)/pip-install-to-json \
-     REPO=$(pwd)/repo STATE_DIR=$(pwd)/state install
+     REPO=$(pwd)/repo STATE_DIR=$(pwd)/.state install
 make -C $(dirname $0)/mbed-cli \
-     REPO=$(pwd)/repo STATE_DIR=$(pwd)/state build
+     REPO=$(pwd)/repo STATE_DIR=$(pwd)/.state build