Let $T >0$ and consider the problem of minimizing
$$
P(v(.)) \triangleq \int_0^T l(x_t,v_t) d t + h(x_T)
$$
over a broad class of control $v(.)$ where
\begin{equation}
\dot x_t = f(x_t,v_t),
\quad x_{t=0} = \xi \in \mathbb{R}.
\end{equation}
For the sake of simplicity, here $x(.)$ and $v(.)$ are real valued functions and $f,l: \mathbb{R} \times \mathbb{R} \to \mathbb{R}$ and $h: \mathbb{R} \to \mathbb{R}$
are smooth functions.
The problem can be studied via the so-called *Pontryagin principle*
that states a necessary condition for optimality as follows:
\begin{equation}
\begin{cases}
& \dot x_t = f(x_t,v^\star[x_t,p_t])\\
& \dot p_t = -H_x(x_t,v^\star[x_t,p_t],p_t)\\
& H(x,v^\star[x,p],p) = \min \limits_{v \in \mathbb{R}} H(x,v,p)
\end{cases}
\end{equation}
with
$$
x_{t=0} = \xi \quad \mbox{and} \quad p_{t=T} = h_x(x_T)
$$
where
\begin{equation}
H(x,v,p) \triangleq l(x,v) + p \cdot f(x,v).
\end{equation}

**Comment**
The functional $P$ above does not involve the value of the control at the terminal time $T$. In all the references I have found it always appears in this way, but it would be quite reasonable to have a terminal cost in the form $h(x_T,v_T)$.

**Question**
What becomes the terminal condition at $t = T$ for the variable $p$
when
$$
P(v(.)) \triangleq \int_0^T l(x_t,v_t) d t + h(x_T, \color{red}{v_T})?
$$
I had a glimpse of the design of the variable $p(.)$, page 112 in https://math.berkeley.edu/~evans/control.course.pdf
(see the variation of the functional $P(.)$ around its optimal control)
and it seems to me that the terminal condition in $p$ remains the same when the terminal is of the form $h(x,v)$.