specenum generator: Initial implementation
Made a proof-of-concept patch, migrating the enums of common/terrain.h; depends on #44767 in that it requires Python 3.6. This just has everything in gen_headers (no separate subdirectory yet). Added that to the include directories as well (meson only in this patch since that's what I'm developing with). It also doesn't support all regular specenum features yet.
I tried to keep the enums def format close to the packets.def format, but I'm not happy with it yet; especially when adding more options. Might have to go with two separate bodies; one for the options, then some kind of marker, then enum constants.
New patch with a better definition format, support for all the specenum things, and moved the current def and generated header (but not the script) to a subdirectory.
Still missing Makefile updates to factor in the new header, because I don't trust my ability to guess how to correctly do that across different directories.
Reply To alienvalkyrie
Still missing Makefile updates
Attached partial patch that should help. I hope you only need to add the include path everywhere.
Your .py seems to be missing executable bit. Not intentionally, I assume.
Finished patch attached. Autotools build works, script is marked executable. Fixed a minor error in a comment as well.
Part of #48675.
This ticket is about writing the script with at least the basic functionality and using it to replace the enums in just one or a few headers (to test/showcase), calling it manually when the definition is changed.