?
Solved

autobuild script

Posted on 2003-03-30
12
Medium Priority
?
315 Views
Last Modified: 2012-05-04
Hi,

I've been working on this for a while, but I just need a website preferably, or a book, that has a different take on what i'm doing.  Must be command line(script) driven and not COM.  The build need only perform with C/C++ files and the update of .rc files has already taken place.

I've looked on MSDN and they have plenty of stuff, but it appears to be updated for .net, I'm working with 6.0 with source downloaded from VSS already.

Thanks for the Input.
Yoshi
0
Comment
Question by:yoshi78
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 6
  • 6
12 Comments
 
LVL 31

Accepted Solution

by:
Zoppo earned 210 total points
ID: 8236846
Hi yoshi78,

you can create a makefile with VS 'Project->Export Makefile'.
With this you can call
> nmake /f YourMakeFile.mak CFG=<Target>
where <Target> is the VS project configuration, i.e.
'YourMakeFile - Win32 Debug'.

So, if you project's name i.e. is MyApp you call
> nmake /f MyApp.mak CFG="MyApp - Win32 Release"
to build the release version.

Further you should enable the option 'Export Makefile when
saving project file' in 'Tools->Options->Build' to ensure the
makefile is actualized with the project.

To automate 'Get Latest Version' from SourceSafe you can use
'SS.EXE', i.e.:

// first set path to srcsafe.ini
Set SSDIR=\\Server\VSS-Path
// or
Set SSDIR=C:\VSS-Path

then you can call 'SS.EXE' to get the files (-R for recursive)
C:\<path to ss.exe>\ss get $/MyApp -R

hope that helps,

ZOPPO
0
 
LVL 1

Author Comment

by:yoshi78
ID: 8238432
ok that's where i've been at for a while.  i've can get the files from the command line but i can't spin off the make file.  But, one of the options I want is to do a partial build of a project or mutiple projects via batch file and for our purposes just make Visual source safe invisible. Keep in mind I have a nice search and explorer type windows to get to any of the files i need via program design.  I just need information on the build outside of the VSS scheme of things.

Thanks again and hope this clears it up.
0
 
LVL 31

Expert Comment

by:Zoppo
ID: 8238610
>i've can get the files from the command line but i can't
>spin off the make file.
Hm ... I'm not sure if I understand it correctly

do you have problems running the 'nmake' or problems exporting
the make file?

In first case maybe you need to run 'Vcvars32.bat' before
starting the make.

ZOPPO
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 1

Author Comment

by:yoshi78
ID: 8238950
okay, this has to be a fluid event without VSS's help in the build area.  So pretend it's not there and you just have the tree of files that came from the repository.  You know where this tree is and can select it or subtrees or multiple trees for link and build.  I need something to do the build with the C++ compiler running in a batch file so I can call it from a program designed to automate the build process. I have one way to do it allready but I'm looking for a better way.
0
 
LVL 31

Expert Comment

by:Zoppo
ID: 8243505
I still can't see the problem ... using the 'nmake' in a batch file
is quite simple ... please describe why this is not suitable
for you.
0
 
LVL 1

Author Comment

by:yoshi78
ID: 8250675
ok sorry, that was my ignorance of nmake you said

you can create a makefile with VS 'Project->Export Makefile'.
With this you can call
> nmake /f YourMakeFile.mak CFG=<Target>
where <Target> is the VS project configuration, i.e.
'YourMakeFile - Win32 Debug'.

i understand that nmake can be run from the command line.  I also understand that a makefile can be spawned inside of visual studio.  The rest i need a little help with.

thanks for the time.
yoshi


0
 
LVL 31

Expert Comment

by:Zoppo
ID: 8251540
hm ... I don't see any 'rest' here ...
if you create a batchfile like

---------------------
// REM mymake.bat
call "c:\program files\Microsoft Visual Studio\VC98\bin\vcvars32.bat
nmake /f %1 CFG=%2
---------------------

you can call it from other batch file or command line like
> mymake c:\myprojects\myapp.mak "MyApp - Win32 Release"
to start the build

What else do you need?

ZOPPO
0
 
LVL 1

Author Comment

by:yoshi78
ID: 8262232
i guess the only other thing i need is a way to create the myapp.mak from the command line, or is that what mymake c:\myprojects\myapp.mak"..." does.  I believe this last line just examines the make file and creates a release build.

Just this last one and I'll leave you alone...:)
thanks for all the help
yoshi
0
 
LVL 31

Expert Comment

by:Zoppo
ID: 8281913
Well, sorry, but I don't know a way to 'auto-generate' the
make files ... but, I even don't think there's a need to ...
as told above you can export the makefile from VS and handle
it like any other source-code file (i.e. put it to VSS) ...
with turning on (as told above) the 'Export Makefile when
saving project file'-option you ensure that any modifications
in the project are also done in the makefile(s).
0
 
LVL 1

Author Comment

by:yoshi78
ID: 8288361
this is being done for a repository of files which need to have an autobuild.  Therefore the workspaces for my customer which is in the 100s will need to have make files manually exported for all.  I was just trying to find a way around it but it looks like they may be out of luck.  Thanks for the info.  I ended up going with MAKE as the client is running win 2000.
0
 
LVL 31

Expert Comment

by:Zoppo
ID: 8290001
Hi again,

sorry, but I just found out that maybe you can also use MSDEV
directly.

calling something like:

\path\to\msdev\MSDEV \path\to\projects\myproject.dsw /make "MyProject - Win32 Release"

should do it either...

ZOPPO
0
 
LVL 1

Author Comment

by:yoshi78
ID: 8296183
you can use MSDEV and here's the make file command(FYI)

msdev.exe MyProject.dsw –execute BuildProjectExport

thanks for the help!
0

Featured Post

[Webinar] Lessons on Recovering from Petya

Skyport is working hard to help customers recover from recent attacks, like the Petya worm. This work has brought to light some important lessons. New malware attacks like this can take down your entire environment. Learn from others mistakes on how to prevent Petya like worms.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

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…
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…
The goal of the video will be to teach the user the difference and consequence of passing data by value vs passing data by reference in C++. An example of passing data by value as well as an example of passing data by reference will be be given. Bot…
The viewer will learn additional member functions of the vector class. Specifically, the capacity and swap member functions will be introduced.
Suggested Courses

765 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