On most ports, you run
# make && make install
. The port will ask you what settings you want, and save your answers in a config file for next time (/var/db/ports/portname/config, I think)
Some ports have not been updated to use this system, and for them you will need to set the variables you have seen. The syntax is
# make WITHOUT_FEATURE="yes" WITH_FEATURE="yes" USE_PROG_VERSION="2.3" install
. You can also use the -D argument to make if you prefer. (make -DWITH_FEATURE )
There are a number of ways to automate things. Ports that use the config system automate themselves. for the others, there are a number of different options.
If you are using portupgrade to manage your ports, then it has a /usr/local/etc/pkgtools.conf file to automate things. The portsconf ports allows you to automatically set ports variables in it's config file. A very clever way is by slightly misusing /etc/make.conf - carpetsmoker at this forum has an example - to insert make variables depending on the port you are building.
Edit
carpetsmoker's make.conf