Fix the circular dependency by moving the generated headers to gdk/version/, and build that directory first. Misc other fixes, such as putting the custom targets as sources, not depedencies, and using the correct major version in the generator script.