University of Lethbridge - CPSC
Using a Makefile in VS 2022 (with NMake)
Assignment 3 - Operator Overloading - SM 25This project requires a Makefile. A Makefile is a text file that defines rules for compiling and linking your code. It tells the compiler how to build your program using commands like cl.exe and link.exe. We will use nmake, which comes included with Visual Studio.
If you are on windows and using Visual Studio then we will use nmake, which comes bundled with Visual Studio, instead of GNU make.
If you are on a Mac or using the command terminal, go to the bottom of this page to see how to use a Makefile.
Step 1: Create a Makefile Project
In Visual Studio 2022, go to File → New → Project.
Search for Makefile Project under C++.
Select Makefile Project, give it a name, and click Create.
When prompted, enter the following NMake commands:
Build Command Line:
nmake /f makefileRebuild Command Line:
nmake /f makefile clean && nmake /f makefileClean Command Line:
nmake /f makefile cleanOutput:
recseq.exe
Keep reading this lesson
You've reached the end of the free preview. Unlock the rest of this lesson plus 27 more lessons in University of Lethbridge - CPSC.
- Unlimited coding questions
- Unlimited access to all classroom material
- Weekly live call for questions and guidance
- 3,000 AI tutor tokens / month
- Personal SQL database (3 MB)
- Progress tracking
Cancel any time.