It's the same here. CDT Internal Builder does not generate the
dependencies correctly but I also don't know how to fix this, maybe it's
still a bug in the dependencies generator of CDT Internal Builder.
You can try to use the external gnu make builder instead if you have gnu
make in your path.
Go to your 'project properties->C/C++ Build->Tool Chain Editor', in field
'Current builder' select 'Gnu Make Builder' and rebuild your project.
Dependencies will then work as expected.