makefile is widely used in systems outside of windows, most programmers rely on the VS IDE, and mastering the use of makefile is useful for automated builds
vs uses nmake.exe as a built tool, unlike Linux's make
Nmake.exe in the VS installation directory,
The default directory for VS2005 is: C:\Program Files\Microsoft Visual Studio 8\VC\bin or C:\Program Files\Microsoft Visual Studio 8\sdk\ V2.0\bin (Typically, the file is the same under both directories)
The default directory for vs2003 is: C:\Program Files\Microsoft Visual Studio. NET 2003\vc7\bin or C:\Program Files\Microsoft Visual Studio. NET 2003\sdk\v1.1\bin
to open the DOS window and enter NMAKE, you may receive the following error message:
this is because during the installation of VS, there is no environment variable to register VS, and you can see if you have registered the environment variables for VS in the following ways:
enter set path in the DOS window and you will see the following prompt:
I have registered the environment variable, and if you don't see it, you can add the bin directory of VS to the path of the system environment directory .
Reopen the DOS window, enter NMAKE, and if prompted below, indicate that the environment directory was registered successfully:
at this point, we can start our compilation, open the DOS window, navigate to the source code directory, execute NMAKE,Note that the compilation for NMAKE corresponds to makefile (no suffix)
If you have several VS versions in your system, it is recommended that you do not add environment variables to the path, as I do:
1. Create a new directory utils under \ C and add the directory to the environment variable of path
2, copy the Vcvars32.bat of Vcvars32.bat and vs2003 under the bin directory of vs2005 to C:\Utils directory, rename Vc8.bat and Vc7.bat
3, execute Vc7.bat (using vs2003 Compilation) or Vc8.bat (compile with vS2005) before executing NMAKE
Using Makefile (a)----deployment under Windows