  In the present paper, we formulate a contact analogue on the one-jet bundle
$J^1B$ of Weinstein's observation which reads the classical action functional
on the cotangent bundle is a generating function of any Hamiltonian isotope of
the zero section. We do this by identifying the correct action functional which
is defined on the space of Hamiltonian-translated (piecewise smooth) horizontal
curves of the contact distribution, which we call the Carnot path space. Then
we give a canonical construction of the Legendrian generating function which is
the Legendrian counterpart of Laudenbach-Sikorav's canonical construction of
the generating function of Hamiltonian isotope of the zero section on the
cotangent bundle which utilizes a finite dimensional approximation of the
action functional.
  Motivated by this construction, we develop a Floer theoretic construction of
spectral invariants for the Legendrian submanifolds in the sequel [OY] which is
the contact analog to the construction given in [Oh97, Oh99] for the Lagrangian
submanifolds in the cotangent bundle.
