Author Topic: Replacing compiler settings with a build script?  (Read 17840 times)

Offline colin

  • Multiple posting newcomer
  • *
  • Posts: 12
Replacing compiler settings with a build script?
« on: March 17, 2014, 04:36:16 pm »
Our company is using Python to check out files from svn and compile in a single step, which also provides arguments for selecting linux destop or a cross-compiler target.
I need to be able to disable Code::Blocks from trying to use GCC or any other compiler and just execute the company script to build the executable target.

I don't want Code::Blocks to use any compiler or makefile but just run the script, put the output into the Build log window and know where the target executable is for debugging, which does currently work when I run the script via a pre-step.
Everything I've tried from saying (*no compiler*) to clearing out makefile settings has failed.

Is there any way to do this?
« Last Edit: March 17, 2014, 04:43:32 pm by colin »

Online stahta01

  • Lives here!
  • ****
  • Posts: 6749
    • My Best Post
Re: Replacing compiler settings with a build script?
« Reply #1 on: March 17, 2014, 05:35:04 pm »
Have you tried setting the "Build Target" to command only?

Edit:
Project -> Properties
Tab "Build Target"
Type: "command only"

Tim S.
« Last Edit: March 17, 2014, 05:37:22 pm by stahta01 »
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 32 bit.
On Debian Stretch, compiling CB Trunk against wxWidgets 3.0.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 12218
    • Travis build status
Re: Replacing compiler settings with a build script?
« Reply #2 on: March 17, 2014, 08:24:24 pm »
Do
1. Project -> Properties -> This is a custom Makefile -> check it
2. Project -> Build options -> Make commands -> edit the commands for build/clean/rebuild
(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 colin

  • Multiple posting newcomer
  • *
  • Posts: 12
Re: Replacing compiler settings with a build script?
« Reply #3 on: March 18, 2014, 09:01:32 am »
Thanks for quick reply, I have tried both of these options but Code::Blocks still tries to use gcc to compile each file, even with a custom makefile.
It would seem the option (*no compiler*) is less than useless as it doesnt allow a build when set.

Also the Build log window no longer produces any output until the whole process is complete, and as a complete build could take 30 minutes that's not particularly helpful.

Is there any way to get the output window to produce anything with custom make so I can debug and see what is going on?
« Last Edit: March 18, 2014, 09:13:39 am by colin »

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 12218
    • Travis build status
Re: Replacing compiler settings with a build script?
« Reply #4 on: March 18, 2014, 09:07:57 am »
Do you see your python script being executed in the log?
If not then you've not setup custom makefile!
(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 colin

  • Multiple posting newcomer
  • *
  • Posts: 12
Re: Replacing compiler settings with a build script?
« Reply #5 on: March 18, 2014, 09:19:48 am »
I've proven that the custom makefile is executing the script as it's producing a binary, and i can delete that binary and use Code::Blocks to generate it with the custom makefile.
I get no output in my build log window from the custom makefile execution, and it still tries to run a GCC compile after the custom makefile saying Target is up to date.

When I tried to do this before as a pre-step I could see output from my script in the Build log.

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 12218
    • Travis build status
Re: Replacing compiler settings with a build script?
« Reply #6 on: March 18, 2014, 09:55:37 am »
Can you show the log?
(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 colin

  • Multiple posting newcomer
  • *
  • Posts: 12
Re: Replacing compiler settings with a build script?
« Reply #7 on: March 18, 2014, 10:17:19 am »
This is all I see...

-------------- Build: Debug in proj.cb.linux_project (compiler: GNU GCC Compiler)---------------

Target is up to date.
Nothing to be done (all items are up-to-date).



When the Build line appears it sits there for a while running my script, then later the message Target is up to date appears.

Offline colin

  • Multiple posting newcomer
  • *
  • Posts: 12
Re: Replacing compiler settings with a build script?
« Reply #8 on: March 21, 2014, 01:48:25 pm »
Due to lack of activity we have abandonded code::blocks and switched to Eclipse for now.
I will keep an eye on this to see if anyone has anything to add.

Thanks so far for all your suggestions.


Colin.

Offline BlueHazzard

  • Developer
  • Lives here!
  • *****
  • Posts: 2590
Re: Replacing compiler settings with a build script?
« Reply #9 on: March 21, 2014, 05:11:35 pm »
this seems as you didn't have configured your project right...
can you try to make a rebuild (the circle arrow or Build->Rebuild) and post the full build log (if the project is configured right this should not work ;) )?

greetings

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 12218
    • Travis build status
Re: Replacing compiler settings with a build script?
« Reply #10 on: March 22, 2014, 10:55:23 am »
In fact there seems to be some kind of a problem with this.  :-\
(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 oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 12218
    • Travis build status
Re: Replacing compiler settings with a build script?
« Reply #11 on: March 22, 2014, 12:02:52 pm »
OK, I've found it. You have to properly implement the "Ask rebuild" command to return 1 (or non-zero) value, in order to make build/rebuild work.

This is what make does:
Quote
       -q, --question
            ``Question mode''.  Do not run any commands, or print anything; just return an exit status that is zero if the specified targets are already up to date, nonzero otherwise.
« Last Edit: March 22, 2014, 12:05:27 pm by oBFusCATed »
(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 oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 12218
    • Travis build status
Re: Replacing compiler settings with a build script?
« Reply #12 on: March 22, 2014, 03:37:57 pm »
I've tried to improve the logging in the latest trunk version, so if you have time you can check it out.
(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 colin

  • Multiple posting newcomer
  • *
  • Posts: 12
Re: Replacing compiler settings with a build script?
« Reply #13 on: March 24, 2014, 12:24:45 pm »
Thanks everyone again, I will make some time this week to look into this further.

Offline colin

  • Multiple posting newcomer
  • *
  • Posts: 12
Re: Replacing compiler settings with a build script?
« Reply #14 on: March 25, 2014, 10:22:17 am »
Okay I just can't face dealing with nightly again, last time I had to hunt forums and try and find some reply somewhere for an ubuntu build.
We have even had other people here try and do the same and find exactly the same problems as I did.
"How to use Nightly" doesn't actually help to use nightly, so I think for now I will just have to abandon using Code::Blocks until I can face it again.

Thanks for help so far though, I just can't put myself through that again...