QNX Makefiles

bridged with qnx.development_tools
Post Reply
Johan Björk

QNX Makefiles

Post by Johan Björk » Mon Jan 12, 2004 6:52 pm

Hi everyone!

I have a project with several subdirectories, which I add to the
compilation using EXTRA_SRCVPATH=...
My issue is that in my diffrent subdirectories, I have files with the
same name. (dir1/myfile.c, dir2/myfile.c)
As it is now, is that the makefiles is processed and a object is
generated for dir1/myfile.c as myfile.o , then as the processing
continues and reaches the second myfile.c, it compiles it and overwrites
the myfile.o created by the first one.

Is it possible to prefix the object files with parhaps the directory
name it is in?
If not, parhaps it's might be a neat feature.

Already solved the problem by changing name on the files, but it'd be
neat to know if there is a better solution.

Thanks in advance

/Johan Björk

Alain Bonnefoy

Re: QNX Makefiles

Post by Alain Bonnefoy » Tue Jan 13, 2004 4:07 pm

Johan Björk a écrit:
Hi everyone!

I have a project with several subdirectories, which I add to the
compilation using EXTRA_SRCVPATH=...
My issue is that in my diffrent subdirectories, I have files with the
same name. (dir1/myfile.c, dir2/myfile.c)
As it is now, is that the makefiles is processed and a object is
generated for dir1/myfile.c as myfile.o , then as the processing
continues and reaches the second myfile.c, it compiles it and
overwrites the myfile.o created by the first one.

Is it possible to prefix the object files with parhaps the directory
name it is in?
If not, parhaps it's might be a neat feature.
Maybe not very common !?!
Are dir1/myfile.c and dir2/myfile.c supposed to give 2 objects linked
together to create a sole executable?
Do you use recursive makefiles.
I think that EXTRA_SRCVPATH is not the solution.
Prefer to create something like dir1/nto/x86/a or dir1/nto/x86/so (same
for dir2, you will get dir1.a, dir2.a or dir1.so, dir2.so) depending if
you prefer to get static or shared libraries and then link the different
libraries to get your executable using EXTRA_LIBVPATH.
Already solved the problem by changing name on the files, but it'd be
neat to know if there is a better solution.

Thanks in advance

/Johan Björk

Johan Björk

Re: QNX Makefiles

Post by Johan Björk » Tue Jan 13, 2004 7:16 pm

"Alain Bonnefoy" <alain.bonnefoy@icbt.com> skrev i meddelandet
news:400417D5.4040409@icbt.com...

Johan Björk a écrit:

Hi everyone!

I have a project with several subdirectories, which I add to the
compilation using EXTRA_SRCVPATH=...
My issue is that in my diffrent subdirectories, I have files with the
same name. (dir1/myfile.c, dir2/myfile.c)
As it is now, is that the makefiles is processed and a object is
generated for dir1/myfile.c as myfile.o , then as the processing
continues and reaches the second myfile.c, it compiles it and
overwrites the myfile.o created by the first one.

Is it possible to prefix the object files with parhaps the directory
name it is in?
If not, parhaps it's might be a neat feature.

Maybe not very common !?!
maybe not :)
Are dir1/myfile.c and dir2/myfile.c supposed to give 2 objects linked
together to create a sole executable?
yep. It originated from two diffrent libraries though, yes.
Do you use recursive makefiles.
I think that EXTRA_SRCVPATH is not the solution.
Prefer to create something like dir1/nto/x86/a or dir1/nto/x86/so (same
for dir2, you will get dir1.a, dir2.a or dir1.so, dir2.so) depending if
you prefer to get static or shared libraries and then link the different
libraries to get your executable using EXTRA_LIBVPATH.

yep, that's one solution
Already solved the problem by changing name on the files, but it'd be
neat to know if there is a better solution.

Thanks in advance

/Johan Björk

Post Reply

Return to “qnx.development_tools”