Page 1 of 1

prevent duplicate object files

Posted: Wed Aug 19, 2015 4:01 pm
by gvandenbosch
Hello,

As I noticed during the compilation of a project all object files are placed in the build directory.
When two files have the same name this runs into problems, with a few files this is no problem and easy to rename.
However I am using a few external libraries now and this is starting to become a problem.

I was wondering if anyone else had encountered this and might have a solution?
It would be great if somehow can rebuild the directory tree in the build directory or get multiple build directories on different levels.

I tried editing the rules.mk myself but I seem to be breaking more than fixing. I am using the 2.6.x release.

Cheers,
Gerard

Re: prevent duplicate object files

Posted: Wed Aug 19, 2015 4:07 pm
by Giovanni
You may compile external libraries into actual .a libraries using a separate makefile, that should not cause conflicts.

I don't think that building an objects subtree is even possible because paths are not necessarily below the project directory, objects could .. out of the build/obj directory.

Giovanni

Re: prevent duplicate object files

Posted: Thu Aug 20, 2015 9:13 am
by gvandenbosch
Hi Giovanni,

Ok I see, making it to a library is on my list.
On your other suggestion, moving the object files out of the build directory, would that have a big impact on the current makefiles?

Cheers,
Gerard

Re: prevent duplicate object files

Posted: Thu Aug 20, 2015 11:22 am
by Giovanni
You could take the old rules.mk from 2.4, it puts objects in the same directory of source files. Probably there are small changes to do.

Giovanni

Re: prevent duplicate object files

Posted: Fri Aug 28, 2015 10:28 am
by gvandenbosch
Hi Giovanni,

Thanks for the pointer, I had to go one version back to 2.2.10.
There were a few changes to be done and then it worked like a charm.

Attached is the modified rules.mk as reference for people that might want to do the same.
This is rules.mk form ARMCMX port.

Cheers,
Gerard