Let us fix some $C>0$. I would like to construct a smooth weight function $w(x): \mathbb{R} \rightarrow \mathbb{R}_{\geq 0}$ such that it is supported on $[-1/2, 1/2]$ and $\int_{- \infty}^{\infty} |w'(x)| dx < C$ while trying to keep $\int_{- \infty}^{\infty} w(x) dx$ as large as possible.
I would appreciate any examples and references. Thank you very much!