Solved

Export a Makefile from command line ?

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

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

When writing generic code, using template meta-programming techniques, it is sometimes useful to know if a type is convertible to another type. A good example of when this might be is if you are writing diagnostic instrumentation for code to generat…
C++ Properties One feature missing from standard C++ that you will find in many other Object Oriented Programming languages is something called a Property (http://www.experts-exchange.com/Programming/Languages/CPP/A_3912-Object-Properties-in-C.ht…
The viewer will learn additional member functions of the vector class. Specifically, the capacity and swap member functions will be introduced.
The viewer will be introduced to the member functions push_back and pop_back of the vector class. The video will teach the difference between the two as well as how to use each one along with its functionality.

707 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

16 Experts available now in Live!

Get 1:1 Help Now