Can't generate dependencies in VS 2005?

J

jpetrang

We use VS6.0 to support our automated build environment, and we'd like
to move to something that is currently supported. One aspect of VS6.0
is part of the "Generate Makefile" feature, which it seems was removed
in VS 2003. Specifically, that feature creates dependency (.dep) files
useful for the automated build environment.

I saw a post that suggested using cl.exe flags (/showincludes, together
with /E or /P) and then write a script to parse that info to get what
we want, but we would like to use the same compiler options for all our
compiles without having this dump happen all the time.

Is there another way to get the dependency information?

Thanks,
Jeanne P
 
C

Carl Daniel [VC++ MVP]

We use VS6.0 to support our automated build environment, and we'd like
to move to something that is currently supported. One aspect of VS6.0
is part of the "Generate Makefile" feature, which it seems was removed
in VS 2003. Specifically, that feature creates dependency (.dep) files
useful for the automated build environment.

I saw a post that suggested using cl.exe flags (/showincludes,
together with /E or /P) and then write a script to parse that info to
get what we want, but we would like to use the same compiler options
for all our compiles without having this dump happen all the time.

Is there another way to get the dependency information?

Nothing built into the product that I know of.

In the past when I needed this information, I wrote a Perl script that would
figure out all the dependencies and write it out as a makefile fragment.
That's a bit of work, but it may be an option.

You can also build the project by simply invoking devenv.exe from the
command line just as you would nmake. For a lighter weight solution,
there's vcbuild.exe (included in VC2005 - I'm not sure about 2003 or 2002).
vcbuild.exe builds a single .vcproj project and is strictly a command-line
tool.

-cd
 
C

Carl Daniel [VC++ MVP]

Carl said:
For a lighter weight solution,
there's vcbuild.exe (included in VC2005 - I'm not sure about 2003 or
2002).

It's definitely in 2003/VC7.1 as well. I no longer have 2002/VC7.0
installed to check that.

-cd
 
G

Guest

We use VS6.0 to support our automated build environment, and we'd like
to move to something that is currently supported. One aspect of VS6.0
is part of the "Generate Makefile" feature, which it seems was removed
in VS 2003. Specifically, that feature creates dependency (.dep) files
useful for the automated build environment.

I saw a post that suggested using cl.exe flags (/showincludes, together
with /E or /P) and then write a script to parse that info to get what
we want, but we would like to use the same compiler options for all our
compiles without having this dump happen all the time.

Is there another way to get the dependency information?

Thanks,
Jeanne P

AFAIK for "classic" makefiles, the /showIncludes is the only way.
The "native" VS way is using proprietary precompiled headers and
the VS as build tool (or vcbuild as a lighter command line tool).
This is the progress - not stepping back ...

Another idea can be replacing cl.exe with your own "wrapper"
that will transparently add /showIncludes and make the .dep file.
So you won't need to change makefiles.
(An example of such wrapper is somewhere in VS2005 sample
programs, it is pretty trivial).

Regards,
--PA
 
J

jpetrang

Thank you for your informative responses, Carl and Pavel. More
below...
Nothing built into the product that I know of.

In the past when I needed this information, I wrote a Perl script that would
figure out all the dependencies and write it out as a makefile fragment.
That's a bit of work, but it may be an option.

Perl may be an option. How did the script get the dependencies? Did it
parse the source code directly (say, the .c and .cpp files to look for
..h files, and the .h files to see if they include any other .h files,
etc) or is there another way?
You can also build the project by simply invoking devenv.exe from the
command line just as you would nmake. For a lighter weight solution,
there's vcbuild.exe (included in VC2005 - I'm not sure about 2003 or 2002).
vcbuild.exe builds a single .vcproj project and is strictly a command-line
tool.

I have already downloaded VC++ Express in order to get vcbuild.exe, to
try it out, but I haven't been able to figure out this depencency
aspect with that approach. Our old VS6.0 command lines with msdev used
the -ex option to invoke a VS macro we wrote which generated the .dep
files the same way the IDE would. So vcbuild.exe cannot invoke macros,
but using devenv (which does support macros, as I understand) wouldn't
help because the ability for VS to create .dep files doesn't exist in
post-6.0 versions, correct?

The reason we want the dependency info is not just to accomplish a
build, but because we co-develop software with external customers and
we will give them some (but not all) source code directly. We use the
..dep info to know which files we need to give them in order to compile
a particular file, and the ability to create a "delivery build" with
just those files is automated
into our build system.

Thanks again,
Jeanne
 
J

jpetrang

Pavel A. wrote:
[snip]
Another idea can be replacing cl.exe with your own "wrapper"
that will transparently add /showIncludes and make the .dep file.
So you won't need to change makefiles.
(An example of such wrapper is somewhere in VS2005 sample
programs, it is pretty trivial).

Can you give me a pointer to this sample program? This isn't enough for
me to go on. Is it online? If it's part of the VS2005 installation, can
you tell me how to locate it?

Thanks,
Jeanne

PS: This email address will bounce. Please post your response. Thank
you!
 
C

Carl Daniel [VC++ MVP]

Pavel A. wrote:
[snip]
Another idea can be replacing cl.exe with your own "wrapper"
that will transparently add /showIncludes and make the .dep file.
So you won't need to change makefiles.
(An example of such wrapper is somewhere in VS2005 sample
programs, it is pretty trivial).

Can you give me a pointer to this sample program? This isn't enough
for me to go on. Is it online? If it's part of the VS2005
installation, can you tell me how to locate it?

The sample is called "ccWrapper". You can find it online at:
http://msdn2.microsoft.com/en-us/library/y209k0z6.aspx

In in the VS 2005 documentation at:
ms-help://MS.MSDNQTR.v80.en/dv_vcsampxpr/samples/compiler/general/ccwrapper.exe

-cd
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top