improved .def file generation, moved externally visible constants to .inc files