swig: fix incremental build in case of removed interface files
!354 (merged) introduced automatic dependency scanning for files
%include
d in a swig interface definition file. This works fine as long as no
such file is removed. But removing a dependent file breaks an incremental build
and make
complains about a missing dependency, see #16830.
Integrate the approach proposed in the issue above into the SWIG-module.
Fixes: #17433 (closed).