generate sub-modules before including files that depend on them