Author Topic: Define $object, $objects, $link_objects, etc  (Read 4980 times)

janknepper

  • Guest
Define $object, $objects, $link_objects, etc
« on: January 27, 2006, 02:24:32 am »
I wondered if there is any way (currently) to *define* how these variables are being generated.
Currently I have source files in different directories, but would like the .o files to be written in 1 directory, no subs. For some reason I have not been able to get Code::Blocks to do this.
It would ne nice however if there was some way to *define* the generation of $object by the build system and as of such of course the generation of $link_object, etc.
Any idea's?

Thanks!
Jan

Offline AkiraDev

  • Multiple posting newcomer
  • *
  • Posts: 71
Re: Define $object, $objects, $link_objects, etc
« Reply #1 on: January 27, 2006, 03:20:54 am »
Project > Properties > Targets should give you control on those parameters.

HTH

Offline Game_Ender

  • Lives here!
  • ****
  • Posts: 551
Re: Define $object, $objects, $link_objects, etc
« Reply #2 on: January 27, 2006, 03:39:16 am »
It really does not do exactly what you want it to do.  Lets say I have this layout:
Code
/root
  /src
    /main
    /extras
  /include
    /main
    /extras
  /obj
  /bin
  cbproject.cbp

Now I want to put all my object files in the object directory like so
Code
/obj
  /main
     /myobject.o
  /extras
     /extraobj.o

What CB does is this:
Code
/obj
  /src
    /main
       /myobject.o
    /extras
       /extraobj.o

It basically mirrors its source tree into the object directory.  This even hapens if the project file is in its own sub directory.  I think this a because problem because CB kind of is built around a project layouts that don't have a specific header and source directory.  You can see this in the project file layouts, I always have separate src, and include directories and the codeblocks project files always have the double Source/src and Include/include structure.  It is kind of annoying.

janknepper

  • Guest
Re: Define $object, $objects, $link_objects, etc
« Reply #3 on: January 27, 2006, 04:12:24 am »
Project > Properties > Targets should give you control on those parameters.

No, as far as I can tell it just let's you use those parameters.
What I would like to do is something as:
$object=make_o($source)
or
$object=make_o($source_path)

A way to *define* how $object is being created/generated.

Thanks!
Jan


janknepper

  • Guest
Re: Define $object, $objects, $link_objects, etc
« Reply #4 on: January 27, 2006, 04:16:10 am »
It basically mirrors its source tree into the object directory.  This even hapens if the project file is in its own sub directory.  I think this a because problem because CB kind of is built around a project layouts that don't have a specific header and source directory.  You can see this in the project file layouts, I always have separate src, and include directories and the codeblocks project files always have the double Source/src and Include/include structure.  It is kind of annoying.

It is more than annoying. Especially if files come more 10+ different directories.
I have tried to remove the -o $object option from the Advanced Compiler Options. That indeed puts the .o in the directory where I want them, but than $link_objects still refers to the .o's in the directory structure and thus will fail.

Thanks!
Jan

Offline mandrav

  • Project Leader
  • Administrator
  • Lives here!
  • *****
  • Posts: 4315
    • Code::Blocks IDE
Re: Define $object, $objects, $link_objects, etc
« Reply #5 on: January 27, 2006, 08:44:09 am »
Quote
It is more than annoying.

You 're welcome to supply a patch.
Be patient!
This bug will be fixed soon...