Typically, you compile either both versions, or compile only a 32-bit version, and require that the user has the 32-bit libraries installed.
You can tell GCC to compile for 32-bit by adding -m32
to every command. Note that this requires a multilib compiler, and you need to have the necessary lib32* files installed.