Parse $(PLATFORM) as $(PLATFORM)-$(PLATFORM_FLAVOR) when it contains a h...

...yphen

One can use:
$ make PLATFORM=vexpress-fvp ...
instead of:
$ make PLATFORM=vexpress PLATFORM_FLAVOR=fvp ...
On Wed, Oct 29, 2014 at 3:37 PM, Jens Wiklander <notifications@github.com>
wrote:

> In Makefile:
>
> > @@ -6,6 +6,13 @@ all:
> >  .PHONY: mem_usage
> >  mem_usage:
> >
> > +# If $(PLATFORM) is defined and contains a hyphen, parse it as
> > +# $(PLATFORM)-$(PLATFORM_FLAVOR) for convenience
> > +ifneq (,$(findstring -,$(PLATFORM)))
> > +ops := $(join PLATFORM PLATFORM_FLAVOR,$(addprefix =,$(subst -, ,$(PLATFORM))))
>
> Wow, I don't understand how it works, but I like it. :-)
>
Yeah I know it's a bit cryptic, but on the positive side it is trivially
extensible if we want to add another variable, say for instance ARCH:
ops := $(join PLATFORM PLATFORM_FLAVOR ARCH,$(addprefix =,$(subst -,
,$(PLATFORM))))
Then give PLATFORM=vexpress-fvp-arm32 and you get ARCH=arm32 :)


> —
> Reply to this email directly or view it on GitHub
> <https://github.com/OP-TEE/optee_os/pull/94/files#r19541439>.
>