User forums > Using Code::Blocks
Use no compiler and Win batch file
gertjan:
Hello,
I did a google search on this topic but cant really find the answer. Although I mostly a Linux guy, I need to revamp an obsolete (bare) code project for an Intel chip using a Cadul compiler (a company no longer in existence). There is a batch file that invokes a unique version of NMAKE.
So.... I just want CodeBlocks to execute the Windows Bat file. Version 17 seemed allow me to do this if I pretend it is a make file. Version 20.03 insists on me choosing a compiler and then invoked min-gw make on the bat file (failing obviously). I absolute need to use the nmake makefile, defining a custom compiler is not an option. My question is therefore:
1. How on 20.03 can I not define a compiler
2. Have it execute a Window Batch file rather then a user-defined Makefile Or
3. tell it to execute my version of NMAKE with arguments and a makefile name.
Codeblocks is a great project and I appreciate any pointers to information.
Gj
oBFusCATed:
Setup a custom makefile project. The compiler in such projects doesn't matter.
In the settings you'll find controls for manually specifying the commands for building.
gertjan:
I appreciate the quick response.
So choose custom makefile (eventhough I need to execute a batch file). But what setting menu are you referring to ?
In BuildOptions--> Release--> Pre/Post build steps I can get it to execute a .bat file (and check 'always execute, even....'). Is this what you mean ?
That (partly) works. However I need to change the working folder. So I added another pre-build step to do a cd, but that fails.
Running target pre-build steps
cd C:\RAE_Source\Hmx-Mss\MSDevPrj\MssHex
Execution of 'cd C:\RAE_Source\Hmx-Mss\MSDevPrj\MssHex' in 'C:\RAE_Source\Hmx-Mss\CodeBlocks' failed.
Alternatively, I see under Projects->Properties->Build Scripts but that is greyed out with the choice of Custom Makefile.
Again, thanks
G
oBFusCATed:
Project -> Build options -> your target -> Make commands
gertjan:
Thanks. I can make that work, although it is not obvious why bat scripts work under the 'makefile' entry boxes. Also it seems the mingw make command is still invoked: Checking if target is up-to-date: mingw32-make.exe -q -f Makefile Release. is executed when I build. Why ? And why is not possible to not specify a compiler ? I think some documentation on running arbitrary scripts would helpful.
Navigation
[0] Message Index
[#] Next page
Go to full version