Instead of hard coding lists of modules that use certain flags, read the files themselves and detecting the flags.