def _mod_to_files(file2deps, modules):

        mod2files = {}

        for mod in modules:
            files = set()
            for file in file2deps:
                if file.find(mod) != -1:
                    files.add(file)

            mod2files[mod] = files

        return mod2files