How to use makefiles in Visual Studio?

2019-01-21 10:00发布

I heard a lot about makefiles and how they simplify the compilation process. I'm using VS2008. Can somebody please suggest some online references or books where I can find out more about how to deal with them?

8条回答
闹够了就滚
2楼-- · 2019-01-21 10:54

To summarize with a complete solution...

There are 2 options:

  1. Use NMAKE from the Developer Command Prompt for Visual Studio

The shortcut exists in your Start Menu. Look inside the makefile to see if there are any 'setup' actions. Actions appear as the first word before a colon. Typically, all good makefiles have an "all" action so you can type: NMAKE all

  1. Create a Solution and Project Files for each binary.

Most well designed open source solutions provide a makefile with a setup action to generate Visual Studio Project Files for you so look for those first in your Makefile.

Otherwise you need to drag and drop each file or group of files and folders into each New Project you create within Visual Studio.

Hope this helps.

查看更多
兄弟一词,经得起流年.
3楼-- · 2019-01-21 11:00

If you are asking about actual command line makefiles then you can export a makefile, or you can call MSBuild on a solution file from the command line. What exactly do you want to do with the makefile?

You can do a search on SO for MSBuild for more details.

查看更多
登录 后发表回答