I'm trying to find a suitable Lagrangian for a damped harmonic oscillator, a system that satisfies the following equation of motion:
$$m \ddot{x} + \gamma \dot{x} + \frac{d\phi}{dx} = 0.$$
What I find in most texts is that the Lagrangian is defined as
$$L = T - V$$
and the dissipation terms are obtained from a separate dissipation function
$$\mathscr{F} = \frac{1}{2}\gamma\dot{x}^2$$
which gives the Lagrange equation
$$\frac{d}{dt}\left(\frac{\partial L}{\partial \dot{x}}\right) - \frac{\partial L}{\partial x} = -\frac{\partial \mathscr{F}}{\partial \dot{x}}.$$
However, I'm trying to derive the EOM from basic variational principles, by setting $\delta S = 0$, where $S$ is the action.
Is there any way to incorporate the dissipation term in the Lagrangian so that this would be possible? If not, why can it not be incorporated?
I am unable to find the reasoning behind this on the texts I've referred to so far (Goldstein as well as Landau-Lishitz), and it would be helpful if someone could direct me towards a resource where I can find something on this.