Solved

Export a Makefile from command line ?

Posted on 1998-10-02
3
421 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 50 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Unlike C#, C++ doesn't have native support for sealing classes (so they cannot be sub-classed). At the cost of a virtual base class pointer it is possible to implement a pseudo sealing mechanism The trick is to virtually inherit from a base class…
IntroductionThis article is the second in a three part article series on the Visual Studio 2008 Debugger.  It provides tips in setting and using breakpoints. If not familiar with this debugger, you can find a basic introduction in the EE article loc…
The goal of the video will be to teach the user the concept of local variables and scope. An example of a locally defined variable will be given as well as an explanation of what scope is in C++. The local variable and concept of scope will be relat…
The viewer will be introduced to the technique of using vectors in C++. The video will cover how to define a vector, store values in the vector and retrieve data from the values stored in the vector.

895 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

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now