We construct a Floer type boundary operator for generalised Morse-Smale dynamical systems on compact smooth manifolds by counting the number of suitable flow lines between closed (both homoclinic and periodic) orbits and isolated critical points. The same principle works for the discrete situation of general combinatorial vector fields, defined by Forman, on CW complexes. We can thus recover the $mathbb{Z}_2$ homology of both smooth and discrete structures directly from the flow lines (V-paths) of our vector field.