In your vertex shader, do something like this:
flat out vec3 v_normal;
In your fragment shader, something like this:
flat in vec3 v_normal;
flat
tells the GL to give all the fragments rasterized for a triangle the same value. Which vertex's normal is used depends on the current 'provoking vertex', set by calling glProvokingVertex
.