Problem of cl.exe when using in makefile

Discussion about CodeLite development process and patches
fanhe0513
CodeLite Enthusiast
Posts: 39
Joined: Sat Aug 21, 2010 7:32 pm
Genuine User: Yes
IDE Question: c++
Contact:

Problem of cl.exe when using in makefile

Post by fanhe0513 »

As well know, we must run vsvars32.bat before using cl.exe in cmd.exe, but this can not be done in makefile.
So currently cl.exe can not be ran in makefile, even if I make a target which running vsvars32.bat firstly.

This will work, puts vsvars32.bat in xxx_wsp.mk, for example:

Code: Select all

all:
	@echo ----------Building project:[ abc - Debug ]----------
	@"D:\Program Files\Microsoft Visual Studio 10.0\Common7\Tools\vsvars32.bat" && cd "abc" && "$(MAKE)" -f "abc.mk"
Are there any other better ways?

Windows XP SP3, visual studio 2010, mingw-4.4.1

Thanks.
foxmuldr
CodeLite Expert
Posts: 120
Joined: Sun May 10, 2009 6:56 am
Contact:

Re: Problem of cl.exe when using in makefile

Post by foxmuldr »

Try running vcvars32.bat in a command window first, and then launching Codelite from within the same command window, as I believe the spawned processes will inherit the modified environment state.
Best regards,
Rick C. Hodgin
www.Visual-FreePro.org
www.LibSF.org
Post Reply