Solved

Export a Makefile from command line ?

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

Ransomware-A Revenue Bonanza for Service Providers

Ransomware – malware that gets on your customers’ computers, encrypts their data, and extorts a hefty ransom for the decryption keys – is a surging new threat.  The purpose of this eBook is to educate the reader about ransomware attacks.

Question has a verified solution.

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

Many modern programming languages support the concept of a property -- a class member that combines characteristics of both a data member and a method.  These are sometimes called "smart fields" because you can add logic that is applied automaticall…
Container Orchestration platforms empower organizations to scale their apps at an exceptional rate. This is the reason numerous innovation-driven companies are moving apps to an appropriated datacenter wide platform that empowers them to scale at a …
The goal of the tutorial is to teach the user how to use functions in C++. The video will cover how to define functions, how to call functions and how to create functions prototypes. Microsoft Visual C++ 2010 Express will be used as a text editor an…
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.

777 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