views:

285

answers:

1

I've inherited a body of Visual C++ source that consists of about a dozen sub-projects. One of these is an empty "MakeAll" project that depends on all the others, so I can build the entire project by setting the MakeAll project active and selecting "Build All."

I'd like to automate this process, and coming from a linux environment, my instinct was to generate a Makefile and build from the command line. The IDE will generate .mak files for each of the sub-projects, but not for the top-level MakeAll. (I'm assuming this is because it contains nothing but dependencies.)

The linux answer would be a Makefile that simply descends into each of the sub-projects and executes make in each one. But a quick look at the .mak files showed that each wants to be told which of several configurations to use -- and apparently some use Debug, some use Release, and some use configurations concocted by a previous developer.

What's the accepted way to build a set of projects like this from the command line?

Thank you!

+1  A: 

You don't have to use make - if you have everything as solution files (.sln) then you can automate the build by using the msbuild tool:

msbuild solution.sln

Also, why do you have a "MakeAll" project? Visual Studio doesn't require this kind of hackery, just do a "build all" and it will build everything satisfying dependancies just like a typical "make all" rule would.

1800 INFORMATION
Thanks for the pointers. The project generates several individual executables and other pieces, and there are several disjoint dependency trees. Can I still get away w/o a MakeAll?
Adam Liss
Visual Studio handles the dependancies much like make would. You can specify dependacies between projects by (from memory) right click -> dependancies
1800 INFORMATION
Hmmm ... might be worth upgrading from MS VS6 just for the tools. Best advice I've gotten from a troll-free number - thanks aagin!!
Adam Liss
You can do much the same trick with VS6, as I recall you basically do something like: msdev.exe solution.sln - the msdev.exe being the same as the visual studio app
1800 INFORMATION