Visual Studio 2003 and 2005 (and perhaps 2008 for all I know) require the command line user to run in the \'Visual Studio Command Prompt\'. When starting this command promp
What the vcvars32 or vsvars32 batch files do is not rocket science. They simply set the PATH, INCLUDE, LIB, and possibly the LIBPATH environment variables to sensible defaults for the particular compiler version.
All you have to do is make sure that those things are set properly for your Ant or makefile (either before invoking them or within them).
For INCLUDE and LIB/LIBPATH an alternative to setting those items in environment variables is to pass those settings to to command line as explicit parameters.