views:

34

answers:

1

Hi,

I have a project in c# which uses bindings to use some c++ code. The c++ code consists of multiple DLL's which are compiled using a makefile. Currently I'm trying to run the makefile using a pre build event which calls nmake. However to get it to find nmake I need to have a line in it like the following:

"$(DevEnvDir)..\..\VC\vcvarsall.bat"

Also, even with that line present, nmake doesn't produce any output at all in the output window. Neither does it throw any errors. I tried redirecting the output to a file and it doesn't write anything. I have reproduced all steps in my pre build event in a normal shell and it works fine. I figure I must be missing something. Why doesn't Visual Studio give me a Visual Studio shell for my pre build event? Is there a better way to run this makefile? If not, has anyone got any ideas as to why nmake isn't producing any output?

EDIT: D'oh! nmake wasn't running as I forgot to add 'call' to the start of the line, i.e:

call "$(DevEnvDir)..\..\VC\vcvarsall.bat"
+1  A: 

I often build non VS-project (sometimes with nmake, sometimes with other build tools) as a part of a larger solution build.

I tend to make a simple batch file, which sets up the environment and then runs the make.

I call the batch file from a build event (often post-build on my stuff) - usually with a CD on the front:

cd ..\.. && armbuild

Never (that I can remember, anyway) had any problem with the output appearing in the console window.

Will Dean
Thanks for the response, I was really just wondering (hoping) I was missing something obvious and there would be a nice easy way to do this. I might try a c++ makefile project but if that fails I'll just use a batch file. I was hoping to be able to use the macros to keep the whole thing a little more portable, but all of the paths in the script are gonna be pretty much the same on all of our machines.
teflon19
I know what you mean, but hopefully if you stick to relative paths, it should all stay portable. Don't forget that however miserable it is to set this stuff up, if you get it right you can forget about it afterwards...
Will Dean