Solved

Export a Makefile from command line ?

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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering 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

Often, when implementing a feature, you won't know how certain events should be handled at the point where they occur and you'd rather defer to the user of your function or class. For example, a XML parser will extract a tag from the source code, wh…
  Included as part of the C++ Standard Template Library (STL) is a collection of generic containers. Each of these containers serves a different purpose and has different pros and cons. It is often difficult to decide which container to use and …
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 learn how to pass data into a function in C++. This is one step further in using functions. Instead of only printing text onto the console, the function will be able to perform calculations with argumentents given by the user.

830 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