[build] move generation folder into target directory

thus we avoid to force generation of modules.h at every build