We present two methods to solve the equation of motion of the cavityless optomechanical system and obtain an explicit formula of the covariance matrix of the evolved state when the initial state is Gaussian. We study the entanglement dynamics of this system initially in the vacuum state. It is shown that bipartite entanglement behaves in a periodic manner. In particular, we can easily generate a genuine three-mode continuous-variable entanglement.