Project Home
Project Home
Trackers
Trackers
Documents
Documents
Wiki
Wiki
Discussion Forums
Discussions
Project Information
Project Info
Forum Topic - Problem with EXTRA_SRCVPATH: (5 Items)
   
Problem with EXTRA_SRCVPATH  
Hello,

Attached there is a simple project that shows the problem. I'm using QNX Momentics IDE v4.0.1.

The project makes a library. It has two variants: 

Variant1 - that should use only sources1/file1.c
Variant2 - that should use both sources1/file1.c and sources2/file2.c

In common.mk source paths are specified correctly:
...
EXTRA_SRCVPATH+=../../sources1
EXTRA_SRCVPATH_ppcbe_Variant2+=../../sources2
...

However, when I build Variant2 it compiles only file1.c and ignores file2.c in folder specified by 
EXTRA_SRCVPATH_ppcbe_Variant2. See the vtest\ppc\a-be-Variant2\ folder - there is just one .o file.

How to make IDE to compile the file from a second folder but for this variant only? I'll appreciate your help.

Thanks in advance,
Stefan
Attachment: Compressed file vtest.zip 5.63 KB
RE: Problem with EXTRA_SRCVPATH  
Looks like you only target ppc. How about add the line below into
ppc/a-be-Variant2/Makefile?

	EXTRA_SRCVPATH += $(PROJECT_ROOT)/sources2

-xtang

> -----Original Message-----
> From: Stefan Witanis [mailto:community-noreply@qnx.com]
> Sent: January 26, 2009 9:55 PM
> To: general-community
> Subject: Problem with EXTRA_SRCVPATH
> 
> Hello,
> 
> Attached there is a simple project that shows the problem. I'm using
QNX
> Momentics IDE v4.0.1.
> 
> The project makes a library. It has two variants:
> 
> Variant1 - that should use only sources1/file1.c
> Variant2 - that should use both sources1/file1.c and sources2/file2.c
> 
> In common.mk source paths are specified correctly:
> ...
> EXTRA_SRCVPATH+=../../sources1
> EXTRA_SRCVPATH_ppcbe_Variant2+=../../sources2
> ...
> 
> However, when I build Variant2 it compiles only file1.c and ignores
> file2.c in folder specified by EXTRA_SRCVPATH_ppcbe_Variant2. See the
> vtest\ppc\a-be-Variant2\ folder - there is just one .o file.
> 
> How to make IDE to compile the file from a second folder but for this
> variant only? I'll appreciate your help.
> 
> Thanks in advance,
> Stefan
> 
> 
> _______________________________________________
> General
> http://community.qnx.com/sf/go/post20806
Re: Problem with EXTRA_SRCVPATH  
I think you can get what you want by adding this:
EXTRA_SRCVPATH+=$(if $(strip $(findstring Variant2, $(CURDIR))),../../sources2)

Essentially this looks at the current directory you are compiling in.  If it matches variant 2 it will add the ../../
sources2 to the extra srcvpath, if not, it wont add anything.

Give it a shot!

> Hello,
> 
> Attached there is a simple project that shows the problem. I'm using QNX 
> Momentics IDE v4.0.1.
> 
> The project makes a library. It has two variants: 
> 
> Variant1 - that should use only sources1/file1.c
> Variant2 - that should use both sources1/file1.c and sources2/file2.c
> 
> In common.mk source paths are specified correctly:
> ...
> EXTRA_SRCVPATH+=../../sources1
> EXTRA_SRCVPATH_ppcbe_Variant2+=../../sources2
> ...
> 
> However, when I build Variant2 it compiles only file1.c and ignores file2.c in
>  folder specified by EXTRA_SRCVPATH_ppcbe_Variant2. See the vtest\ppc\a-be-
> Variant2\ folder - there is just one .o file.
> 
> How to make IDE to compile the file from a second folder but for this variant 
> only? I'll appreciate your help.
> 
> Thanks in advance,
> Stefan


Re: Problem with EXTRA_SRCVPATH  
Both solutions work :-)
I'll probably stay with Andy's proposal as it keeps all in one file.
I still wonder if this is a know bug of IDE.
Thanks!
Stefan
Re: Problem with EXTRA_SRCVPATH  
We kind of short of resources, I enter PR65025 for this problem, when we have a chance we look at it,
I cannot tell right now if it is a bug or what...


Stefan Witanis wrote:
> Both solutions work :-)
> I'll probably stay with Andy's proposal as it keeps all in one file.
> I still wonder if this is a know bug of IDE.
> Thanks!
> Stefan
> 
> 
> _______________________________________________
> General
> http://community.qnx.com/sf/go/post20965
>