Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to compile code with visual studio using makefile

Tags:

I have just downloaded a open source project which is said to be compiled using visual studio c++. It contains 3 makeFiles (makeFile, makeFile(1) and makeFile(2) ) I always open programs in VS using the .sln files and now I dont know what to do with this makeFile. can anyone instruct me how to deal with it please.

regards

like image 212
Hossein Dolatabadi Avatar asked Apr 04 '13 06:04

Hossein Dolatabadi


People also ask

How do I compile a code in Visual Studio?

Build and run your code in Visual Studio To build your project, choose Build Solution from the Build menu. The Output window shows the results of the build process. To run the code, on the menu bar, choose Debug, Start without debugging. A console window opens and then runs your app.

Is Makefile a compiler?

Makefile is a set of commands (similar to terminal commands) with variable names and targets to create object file and to remove them. In a single make file we can create multiple targets to compile and to remove object, binary files. You can compile your project (program) any number of times by using Makefile.

How do I run Makefile?

Before running a Makefile in Windows, it is required to install the make command first by using the “Mingw-get install mingw32-make” command on the Command Prompt. Then, create a Makefile, remove the “. txt” extension, and use the “make” command to run the specified Makefile in Windows.


2 Answers

You may try NMake. See NMake Reference and Stackoverflow post.

NMake is included with Visual Studio. You may try with NMake shipped with the edition of Visual Studio you may want to use.

like image 53
Vivek Jain Avatar answered Oct 31 '22 08:10

Vivek Jain


If you are only familiar with Visual Studio projects and solutions, dealing with makefiles can be a challenge. The following link will give you a good introduction to makefiles from a Visual studio perspective.

An introduction to Makefiles for Visual Studio developers

Translating Linux makefiles to Visual Studio solution will be a manual effort.

NMake looks promising. However, the following link takes a simple Makefile and explains some fundamental issues that one may encounter.

Makefiles in Windows

like image 28
ap-osd Avatar answered Oct 31 '22 08:10

ap-osd