Author Topic: Use no compiler and Win batch file  (Read 4451 times)

Offline gertjan

  • Single posting newcomer
  • *
  • Posts: 4
Use no compiler and Win batch file
« on: November 12, 2020, 08:36:26 pm »
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

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: Use no compiler and Win batch file
« Reply #1 on: November 12, 2020, 11:52:11 pm »
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.
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline gertjan

  • Single posting newcomer
  • *
  • Posts: 4
Re: Use no compiler and Win batch file
« Reply #2 on: November 13, 2020, 12:35:54 am »
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

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: Use no compiler and Win batch file
« Reply #3 on: November 13, 2020, 01:38:12 am »
Project -> Build options -> your target -> Make commands
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline gertjan

  • Single posting newcomer
  • *
  • Posts: 4
Re: Use no compiler and Win batch file
« Reply #4 on: November 16, 2020, 06:29:14 pm »
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.

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: Use no compiler and Win batch file
« Reply #5 on: November 17, 2020, 01:07:40 am »
What do you mean by setup a compiler? It doesn't matter, because C::B expects that your script/makefile would do all the building and compiler setup.

"mingw32-make.exe -q -f Makefile Release" could be replaced with something which just exit codes to 0.
It is used to query if there are changes and if there is a reason to run a full build.
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline gertjan

  • Single posting newcomer
  • *
  • Posts: 4
Re: Use no compiler and Win batch file
« Reply #6 on: November 17, 2020, 08:51:34 pm »
I don't intent to start a debate here.

My thought process (as a developer of industrial software products) is that if a user wants to completely stay away from any compiler known to CB, the intuitive step would be to start by selecting 'no compiler'. That does not seem possible.  Secondly, the fact that the custom makefile options have to be used for executing a (non-makefile) script combined with the fact that CB is clearly trying to still execute a make file (using mingw make) results in less than obvious user configuration steps. 
Right now CB does for me what I need it to - my subsequent posts are in the hope someone can use the feedback to perfect an already impressive project.

Cheers

G