Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Running MSDEV to build C++ projects from a BAT file

585 views
Skip to first unread message

David Schwartz

unread,
May 26, 2000, 3:00:00 AM5/26/00
to
I currently export make files from Visual Studio, and use the generated
make files as part of a large batch driven software build process. Since
the make files are just based on the project (dsp) files, it seems like
there should be a mechanism for building projects from a batch file without
generating the make file. According to the MSDN documentation and
MSDEV/? this feature is supported:

MSDEV [myprj.dsp|mywksp.dsw] - load project/workspace
[<filename>] - load source file
/? - display usage information
/EX <macroname> - execute a VBScript macro
/OUT <filename> - redirect command line output to a file
/USEENV - ignore tools.options.directories settings
/MAKE [<target>] [...] - build specified target(s)
[<project> - <platform> <configname>]
[[<project>|ALL] - [DEBUG|RELEASE|ALL]]
/CLEAN - delete intermediate files but don't build
/REBUILD - clean and build
/NORECURSE - don't build dependent projects

I have a work space called test.dsw which contains a single project
test.dsp. Using MSDEV.EXE from Visual Studio 6.0 SP3, the command line
syntax does not work as expected:

C:\Test>msdev test.dsw /MAKE test.dsp RELEASE
Warning: ignoring unknown project: RELEASE
Warning: ignoring unknown project: test.dsp
Error: There are no valid targets to build.

C:\Test>msdev test.dsw /MAKE test RELEASE
Warning: ignoring unknown project: RELEASE
Warning: ignoring unknown target: test
Error: There are no valid targets to build.

C:\Test>msdev test.dsw /MAKE ALL
--------------------Configuration: test - Win32 Release--------------------

test.dll - 0 error(s), 0 warning(s)
--------------------Configuration: test - Win32 Debug--------------------

test.dll - 0 error(s), 0 warning(s)

I would like to build the release or debug targets individually.
Does anyone know the correct "magic" to make this work?

Thank you,

David Schwartz

Katy Mulvey [MVP]

unread,
May 26, 2000, 3:00:00 AM5/26/00
to
In <392EC3FF...@marathontechnologies.com>, David Schwartz

<dsch...@marathontechnologies.com> wrote:
>I have a work space called test.dsw which contains a single project
>test.dsp. Using MSDEV.EXE from Visual Studio 6.0 SP3, the command line
>syntax does not work as expected:
>
>C:\Test>msdev test.dsw /MAKE test.dsp RELEASE
>Warning: ignoring unknown project: RELEASE
>Warning: ignoring unknown project: test.dsp
>Error: There are no valid targets to build.
>
>C:\Test>msdev test.dsw /MAKE test RELEASE
>Warning: ignoring unknown project: RELEASE
>Warning: ignoring unknown target: test
>Error: There are no valid targets to build.
>[...]

>I would like to build the release or debug targets individually.
>Does anyone know the correct "magic" to make this work?

The targets aren't called "RELEASE" and "DEBUG", they're called
"test - Win32 Release" and "test - Win32 Debug".

Try this:
C:\TEST> msdev test.dsw /MAKE "test - Win32 Debug"

I'm not entirely sure what the help msdev gives you is trying
to get at when it says

/MAKE [<target>] [...] - build specified target(s)
[<project> - <platform> <configname>]
[[<project>|ALL] - [DEBUG|RELEASE|ALL]]

But my example above uses the second format.

--
- Katy

Katy Mulvey Please post replies to the newsgroup, thanks!
ORMEC Systems Check out the VC++ FAQ: http://www.mvps.org/vcfaq
http://www.ormec.com MVP/VC++ http://support.microsoft.com/support/mvp

Kyle Alons

unread,
May 30, 2000, 3:00:00 AM5/30/00
to
A tool called Visual Build (www.kinook.com) comes with a tool called
VCMake.vbs that provides a better way to automated your C++ builds. See the
comments in the script for why it's better.

"David Schwartz" <dsch...@marathontechnologies.com> wrote in message
news:392EC3FF...@marathontechnologies.com...


> I currently export make files from Visual Studio, and use the generated
> make files as part of a large batch driven software build process. Since
> the make files are just based on the project (dsp) files, it seems like
> there should be a mechanism for building projects from a batch file
without
> generating the make file. According to the MSDN documentation and
> MSDEV/? this feature is supported:
>
> MSDEV [myprj.dsp|mywksp.dsw] - load project/workspace
> [<filename>] - load source file
> /? - display usage information
> /EX <macroname> - execute a VBScript macro
> /OUT <filename> - redirect command line output to a file
> /USEENV - ignore tools.options.directories
settings

> /MAKE [<target>] [...] - build specified target(s)
> [<project> - <platform> <configname>]
> [[<project>|ALL] - [DEBUG|RELEASE|ALL]]

> /CLEAN - delete intermediate files but don't
build
> /REBUILD - clean and build
> /NORECURSE - don't build dependent projects
>

> I have a work space called test.dsw which contains a single project
> test.dsp. Using MSDEV.EXE from Visual Studio 6.0 SP3, the command line
> syntax does not work as expected:
>
> C:\Test>msdev test.dsw /MAKE test.dsp RELEASE
> Warning: ignoring unknown project: RELEASE
> Warning: ignoring unknown project: test.dsp
> Error: There are no valid targets to build.
>
> C:\Test>msdev test.dsw /MAKE test RELEASE
> Warning: ignoring unknown project: RELEASE
> Warning: ignoring unknown target: test
> Error: There are no valid targets to build.
>

> C:\Test>msdev test.dsw /MAKE ALL
> --------------------Configuration: test - Win32
Release--------------------
>
> test.dll - 0 error(s), 0 warning(s)
> --------------------Configuration: test - Win32 Debug--------------------
>
> test.dll - 0 error(s), 0 warning(s)
>

> I would like to build the release or debug targets individually.
> Does anyone know the correct "magic" to make this work?
>

> Thank you,
>
> David Schwartz

David Schwartz

unread,
May 31, 2000, 3:00:00 AM5/31/00
to
After considerable digging through the MSDN documentation I
found the correct syntax. It was well hidden in the "Windows CE
Toolkit for Visual Studio" documentation, a perfectly logical
place to put it.

msdev test.dsp /MAKE "test - Win32 Debug" /REBUILD

David Schwartz

Bradley Johnston

unread,
Jun 2, 2000, 3:00:00 AM6/2/00
to
Hello David,

Currently I use...
msdev d:\app_name\app_name.dsw /MAKE "ALL - Win32 Release" /REBUILD /OUT
d:\build\history\report01.log

What I want to know is this; "/REBUILD" cleans up intermediate files and
build all projects. So it acts like the Visual C++ IDE build menu's "Batch
Build" & Rebuild all option. And "/CLEAN" cleans up intermediate files but
does not build. BUT, how do I write an MSDEV command line that will re-build
only if the target is out of date? I want an option like the Build Menu's
"Batch Build" & BUILD options.

Thank you,

Bradley Johnston


David Schwartz <dsch...@marathontechnologies.com> wrote in message

news:393555C7...@marathontechnologies.com...

0 new messages