What is the functional derivative of a functional $F$ that is expressed as a volume integral over a region $\Omega\subset\mathbb R^3$ plus a surface integral over the boundary $\partial\Omega$? An example for such a functional is $$ F[c] = \int_\Omega f(c, \nabla c) \, \mathrm{d}V + \oint_{\partial\Omega} g(c) \, \mathrm{d} S \;. $$ I think that inside the domain the functional derivative reads $$ \frac{\delta F}{\delta c} = \frac{\partial f}{\partial c} - \nabla \frac{\partial f}{\partial (\nabla c)} \;, $$ but I do not know how to deal with the boundary. I'm not even sure whether the problem is well-posed (even assuming reasonably nice properties of $\Omega$, $f$, and $g$).
My more general question therefore is how one deals with functionals of the aforementioned structure.