Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
?
Solved

autobuild script

Posted on 2003-03-30
12
Medium Priority
?
321 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
  • 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
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

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

Templates For Beginners Or How To Encourage The Compiler To Work For You Introduction This tutorial is targeted at the reader who is, perhaps, familiar with the basics of C++ but would prefer a little slower introduction to the more ad…
Article by: evilrix
Looking for a way to avoid searching through large data sets for data that doesn't exist? A Bloom Filter might be what you need. This data structure is a probabilistic filter that allows you to avoid unnecessary searches when you know the data defin…
The goal of the tutorial is to teach the user how to use functions in C++. The video will cover how to define functions, how to call functions and how to create functions prototypes. Microsoft Visual C++ 2010 Express will be used as a text editor an…
The viewer will learn how to clear a vector as well as how to detect empty vectors in C++.

571 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