How do you generate file dependence when writing Makefile?

fpt generates makefiles (http://simconglobal.com).
It assumes that modules create .mod and .o files and handles the dependencies separately. But the current version doesn’t handle sub-modules. Working on it.