build the TMP directory recursively