Shape optimization by the homogenization method