Build matrix.