diff --git a/build-all.sh b/build-all.sh
index 7284bd20cfe8fc3d6a5d35161186a365d56e6963..bef304bb8c82d749d0bfb79ac40c52cf2a334906 100755
--- a/build-all.sh
+++ b/build-all.sh
@@ -47,17 +47,19 @@ if [ ! "$SMPSA_HOME" ]; then
     echo "SMPSA_HOME not set."; 
     exit 1; 
 fi
-cd $SMPSA_HOME
-scons  || exit
 
 # security-transforms
 if [ ! "$SECURITY_TRANSFORMS_HOME" ]; then 
     echo "SECURITY_TRANSFORMS_HOME not set."; 
     exit 1; 
 fi
+
 cd $SECURITY_TRANSFORMS_HOME
 scons || exit
 
+cd $SMPSA_HOME
+scons  || exit
+
 cd $PEASOUP_HOME
 make || exit