REQUIRES specification

Norman Feske norman.feske at ...1...
Fri Mar 18 20:23:43 CET 2011


Hi Danial,

> Is it possible to use an OR condition for the "REQUIRES =" tag in a
> specs file?

No. But there are two alternatives use to work well for us. Assume, you
want to express something like

  REQUIRES = versatilepb | pbx

First, you may revisit the reason of why the OS condition is needed -
mostly it's because the two alternatives have something in common. For
example, a certain device accessed by the target, let's say pl0505, is
available on the 'versatilepb' as well as on 'pbx' platforms. So why not
introducing 'pl050' as a new SPEC value? Then the above declaration
would become

  REQUIRES = pl050

To avoid the manual enumeration of all spec details of 'versatilepb' in
'<build-dir>/etc/specs.conf', you can introduce a
'mk/spec-versatilepb.mk' file that extends the 'SPECS' variable with all
parts that are available on the 'versatilebp' platform. Just take a look
at 'base/mk/spec-platform_versatilepb.mk' to see how this works.

Second, you can use two 'target.mk' files, each residing in a different
subdirectory. Each is only extending the 'REQUIRES' variable by its
specific value ('REQUIRES += versatilepb' respectively 'REQUIRES +=
pbx'), and includes a common 'target.inc' file ('include
$(PRG_DIR)/../target.inc') with all of the common parts of both targets.
For an example, you may have a look at 'os/src/ldso/target.inc' and
'os/src/ldso/{x86_32,x86_64,arm}/target.mk'.

Best regards
Norman

-- 
Dr.-Ing. Norman Feske
Genode Labs

http://www.genode-labs.com · http://genode.org

Genode Labs GmbH · Amtsgericht Dresden · HRB 28424 · Sitz Dresden
Geschäftsführer: Dr.-Ing. Norman Feske, Christian Helmuth




More information about the users mailing list