Hi Jonatan,

I have about the same setup that you do. I use a variable "PLATFORM" that
is defined for each variant. In each platform's Tupfile, I add include
guards:

ifeq (@(PLATFORM),stm32f1)
include_rules

: foreach *.c |> !cc |> %B.o ../../<objs>
endif

I think this should do what you want?

On Thu, Oct 23, 2014 at 12:42 PM, Jonatan Olofsson <
[email protected]> wrote:

> Hi,
>
> I want to build .o-files from sources in one of several possible
> subdirectories, and I want their output to be put in the corresponding
> subdirectory.
>
> Allow me to demonstrate my problem with an example;
>
> I have an embedded application which may be built for multiple MCU's.
> For this, there are two directories
>
> libmaple/stm32f1/
> libmaple/stm32f2/
>
>
> For a certain tup variant, only one of these are applicable, so in their
> parent directory i have
>
> include @(MCU_SERIES)/rules.tup
>
> which allows me to specify which of these should be included.
>
>    - Note that, with a Tupfile in each directory, both directories would
>    always be built, which is what I want to avoid. Hence, I can't use a 
> Tupfile
>
> Now, with the include command, it is possible to select the files I want.
> In my attempts on build-rules however, I have found no alternative to usign
> %B flag to specify the outputs. %B removes the subdirectory, which will put
> the output in the libmaple directory - which will cause name clashing. I
> need the output in the subdirectory besides its source.
>
>    - Thus, it seems I can't use the include command, without possibly an
>    added %-flag which does not remove subdirectories.
>
> I am kind of stuck here, and out of alternatives: How do I optionally
> build a subdirectory?
>
> Best Regards,
> Jonatan Olofsson
>
> --
> --
> tup-users mailing list
> email: [email protected]
> unsubscribe: [email protected]
> options: http://groups.google.com/group/tup-users?hl=en
> ---
> You received this message because you are subscribed to the Google Groups
> "tup-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> For more options, visit https://groups.google.com/d/optout.
>

-- 
-- 
tup-users mailing list
email: [email protected]
unsubscribe: [email protected]
options: http://groups.google.com/group/tup-users?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"tup-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to