Generalizing Turán's classical extremal problem, Alon and Shikhelman
investigated the problem of maximizing the number of $T$ copies in an $H$-free
graph, for a pair of graphs $T$ and $H$. Whereas Alon and Shikhelman were
primarily interested in determining the order of magnitude for large classes of
graphs $H$, we focus on the case when $T$ and $H$ are paths, where we find
asymptotic and in some cases exact results. We also consider other structures
like stars and the set of cycles of length at least $k$, where we derive
asymptotically sharp estimates. Our results generalize well-known extremal
theorems of Erdős and Gallai.