> I'm not really familiar with NMake but I can say that you might want
> to try using MSBuild for this sort of thing instead, build some .NET
[quoted text clipped - 34 lines]
> extension of ".bat" and then you can run this batch file by double
> clicking it or as an executable from a command line. Hope that helps!
Hello Justin;
First of all, thanks for the reply.
Second, I must say that this wasn't the answer I was looking for, as I have
tried it already, and I have discivered that the problem is much deeper. I
will post now the full problem and answer, hopefully it will help someone
sometime;
Problem:
- Inside a makefile, I was, for each file which meets a condition, to run a
program, get its return value and use it as a parameter for another
program(s). (please see original post)
- nmake will not preserve ERRORLEVEL environmental, or any other
environmentals from the running of prog1.exe
- prog2.exe needs more parameters which are dependant upon the makefile,
like: filename (from the rule) etc.
Solution:
Create a batch file "on the fly" using inline files. It's not very "clean"
solutin (and I will clarufy immidatley why) but it works...
example:
.cpp.o:
temp.bat << temp.bat
@echo off
prog1.exe $@
gcc.exe $@ -DVAR=%ERRORLEVEL% -o $<.exe
<<NOKEEP
and why this solution is not clean? It will cleanly create the file temp.bat
on disk and will erase it after wards. The only problem is that it will not
run "temp.bat" but "temp.bat temp.bat", which prevents you from using the
parameters (%1, %2....) or temp.bat inside it.
But that's what I have :)
Hope it helps,
Boaz