cmake: Add wrapper top-level makefile.
globalstate: Split global state into separate header.