Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Export a Makefile from command line ?

Posted on 1998-10-02
3
Medium Priority
?
428 Views
Last Modified: 2012-05-04
I would like to completely automate the build of many
VC++ DevStudio projects.  The "Export Makefile" command
inside of DevStudio is great, but I want to completely
automate with a batch file.  Is there any way to create
a makefile for a project from the command line?

Thanks,
Dave
0
Comment
Question by:be164
  • 2
3 Comments
 
LVL 8

Accepted Solution

by:
Answers2000 earned 150 total points
ID: 1174292
This is an answer to the intent rather than the exact method you propose.

1. Rely on Visual C++ writing out the correct make file.  Tools/Options/Build - you can check the box to export the make file whenever you save your project.  Do so.  


2. In each project sub-directory you will then have a MAKE file which builds than project.

Say you have

\MYWORK\A containing a project.  The Make File will be A.MAK
\MYWORK\B containing a 2nd project.  The Make File will be B.MAK

3. Build a master make file (manually) in the directory above (for example).  You can then list the dependencies for each project, the targets and the make command, for example

\MYWORK\A\RELEASE\A.EXE : \MYWORK\A\A.CPP \MYWORK\A\A.RC \MYWORK\A\A.H \MYWORK\A\A.MAK
   CD A
   NMAKE -F A.MAK
   CD ..

Invoke the master make from the command line.


The key is tip #1.  Rely on visual studio outputting the correct make file automatically.  There is no command line way to get it to spit out the make file "on demand".


0
 

Author Comment

by:be164
ID: 1174293
>The key is tip #1.  Rely on visual studio outputting the correct >make file automatically.  There is no command line way to get it >to spit out the make file "on demand".

I was hoping there was a way around this since the developers
of the individual pieces typically don't use makefiles.
0
 
LVL 8

Expert Comment

by:Answers2000
ID: 1174294
I had the same problem on a large system I was developing/leading.

Get all developers to check the Export option (not too much work for them) and keep to your defined directory structure.

Once I had this in place, we set up nightly builds, automated creation of installation images, and nightly auto tests.  Developers soon saw the benefit of this...
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction This article is the first in a series of articles about the C/C++ Visual Studio Express debugger.  It provides a quick start guide in using the debugger. Part 2 focuses on additional topics in breakpoints.  Lastly, Part 3 focuses on th…
Introduction This article is a continuation of the C/C++ Visual Studio Express debugger series. Part 1 provided a quick start guide in using the debugger. Part 2 focused on additional topics in breakpoints. As your assignments become a little more …
The viewer will learn how to user default arguments when defining functions. This method of defining functions will be contrasted with the non-default-argument of defining functions.
The viewer will learn additional member functions of the vector class. Specifically, the capacity and swap member functions will be introduced.
Suggested Courses

972 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question