Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Languages / Managed C++ / July 2006

Tip: Looking for answers? Try searching our database.

Can't generate dependencies in VS 2005?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
jpetrang@harris.com - 21 Jul 2006 20:33 GMT
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
Carl Daniel [VC++ MVP] - 22 Jul 2006 22:57 GMT
> 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
[quoted text clipped - 8 lines]
>
> 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
Carl Daniel [VC++ MVP] - 22 Jul 2006 23:01 GMT
> 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
jpetrang@harris.com - 24 Jul 2006 15:20 GMT
Thank you for your informative responses, Carl and Pavel.  More
below...

> > 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
[quoted text clipped - 14 lines]
> 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
Pavel A. - 22 Jul 2006 23:54 GMT
> 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
[quoted text clipped - 11 lines]
> 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
jpetrang@harris.com - 27 Jul 2006 19:34 GMT
[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!
Carl Daniel [VC++ MVP] - 28 Jul 2006 04:05 GMT
> [snip]
>> Another idea can be replacing  cl.exe with your own "wrapper"
[quoted text clipped - 6 lines]
> 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

Rate this thread:







Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.