Makefile generator does not regenerate if a custom command creates a file the configuration depends on
If you have a custom command that generates a file list, and then you include() that file, or CMAKE_CONFIGURE_DEPENDS on it then the makefile generator will require you to run make twice, as the Makefile is not the output of any command. The configure dependencies are only checked at startup by the phony cmake_check_build_system target. The build works as expected with the Ninja and Visual Studio generators (I haven't checked any others).
I have fixed my issue in the following commit: patstew/cmake@bdefd82f
Basically I have added a check so that the convenience target of a custom command is added as a dependency of Makefile2, so Makefile2 will recheck the configuration after that target runs.
I'm not really sure whether that's on the right track or just a kludge, as I don't fully understand the rationale behind the multi-level makefile structure. It would be easy to just add the relevant files as dependencies if it wasn't split into multiple Makefiles all run with different invocations of make. Also, perhaps Makefile targets are not supported by all supported versions of make?