Mechanics of generalized continua: construction by homogenizaton