You really need build system support. For example, Ninja can generate the file without actually doing the build because it knows everything it _would_ do.