Author Topic: tips needed to add a new toolchain.  (Read 5024 times)

Offline sanjivg

  • Multiple posting newcomer
  • *
  • Posts: 16
tips needed to add a new toolchain.
« on: September 13, 2005, 12:40:59 pm »
Here is what I want to do with code::blocks.

I want to add a new toolchain. This toolchain has following components.

1. compiler
2. assembler
3. linker
4. debugger

A typical programming project may have following files.
1. .c/.h files
2. .s files written in assembler by the programmer.

How can I a make code::blocks to invoke assembler directly for the .s or .asm files? The
programmer should be able to specify/change assembler flags also.

How can I customize the debugger invocation?

one approach I could think of is to tweak the makefile generation, and let the
compilation go with using make.

Any suggestions on how to proceed?

thanks and regards
sanjiv

Offline thomas

  • Administrator
  • Lives here!
  • *****
  • Posts: 3979
Re: tips needed to add a new toolchain.
« Reply #1 on: September 13, 2005, 02:37:09 pm »
First, to get your source compiled:




If your as is not in C:\mingw\bin, then you will of course another path.


And then you may want to add the object file to the linker's options accessible via "Build Options" in the project menu, and possibly to dependencies accessible via "Preferences" in the project menu, too (the latter should not be necessary, but still, it doesn't harm either).


EDIT:

Hmm... probably you're off better by checking "Link file" than going to linker prefs ;)

I never need to link, since I only use that functionality to compile my cg shaders - those aren't linked with the executable of course, hence I forgot to check that option in the screenshot, sorry.
« Last Edit: September 13, 2005, 02:46:27 pm by thomas »
"We should forget about small efficiencies, say about 97% of the time: Premature quotation is the root of public humiliation."

Offline sanjivg

  • Multiple posting newcomer
  • *
  • Posts: 16
Re: tips needed to add a new toolchain.
« Reply #2 on: September 13, 2005, 04:19:26 pm »
Thank you very much. I am a newbie here and trying to understand how code::blocks works.

is it possible to specify some common flags for all .s files in my project, so that I dont need to specify them for each file?
logically both .c files and .s files belong to a single target, but I just want to specify different compilers/flags for these.


Offline thomas

  • Administrator
  • Lives here!
  • *****
  • Posts: 3979
Re: tips needed to add a new toolchain.
« Reply #3 on: September 13, 2005, 04:40:35 pm »
Unluckily, you only get it done like this at the present time, there is no general config that I know of.
If you have dozens of assembler files, then using inline assembly might be easier maybe?

However, the build process is under heavy development, and some day in the future, there will be a very much improved, generalized build system which will be a lot more configurable.

To get custom flags, you may try the "Build" tab instead of the "Advanced" tab in the source file's properties. There, you have even more options, but it is also a lot easier to break the build, of course.
« Last Edit: September 13, 2005, 04:43:02 pm by thomas »
"We should forget about small efficiencies, say about 97% of the time: Premature quotation is the root of public humiliation."