build: generator: Redo most of it

Signed-off-by: Bart Kuivenhoven <bemkuivenhoven@gmail.com>