[GBUILD] Can we get rid of recursively invoking custom targets ?

Matúš Kukan matus.kukan at gmail.com
Tue Mar 20 13:04:24 PDT 2012


On 20 March 2012 11:17, Michael Stahl <mstahl at redhat.com> wrote:
> 1. var namespace collisions:
>   because make doesn't have namespaces for global variables, it's
>   possible that variables defined in different modules' custom
>   makefiles have the same name and thus collide.
>   this can be avoided by agreeing to a naming convention, such as
>   prefixing all variables by the name of the module where they are
>   defined, and reviewing all custom makefiles so that this convention
>   is met.

We have to create custom makefiles, so no problem with reviewing.
But is it really such problem ? I mean, we can't use INCLUDE variable of course
but if some variable is used in different custom makefile and we are
initializing it,
there should be no problem, because as make is parsing makefile, it
will be properly set.
Anyway, we can grep for the name of variable and set it that way, so
there is no collision.
I would really like to use only short variables for the working directory,
because they are used often and I think it is more readable then.

> 2. pattern rule collisions:
>   the pattern rules defined in a lot of custom makefiles also can lead
>   to collisions, both with other custom makefiles, and with the
>   pattern rules defined in solenv/gbuild, which is complicated due
>   to different pattern rule matching in make 3.81 and 3.82.
>   so the pattern rules in custom makefiles should all have targets of
>   the form $(WORKDIR)/CustomTarget/$(MODULE)/... and this prefix
>   should be different across modules and so the problem of getting
>   these to work in 3.81 and 3.82 should be module local and hence
>   hopefully manageable.

Ah, I did not think about this. So, what are the rules for pattern matching?
I thought make 3.81 picks first one and make 3.82 the one with longest
matching prefix.
oh, well, it does not matter, you are right,
(WORKDIR)/CustomTarget/$(MODULE)/ is good since there is nothing colliding.
So, no problem.

> but please rename the CDPI variable to packimages_CDPI or expand it
> (also, CUSTOM_images, CUSTOM_PREFERRED_FALLBACK_[12])

CDPI was supposed to be custom-target-directory-packimages.
That's not good because CD would be the same for all custom targets,
but 3(4) letters should be enough? First two for <module> and third
(or also fourth) for directory in module.
It must be enough to avoid collision, we don't have so many modules.

Also, there is no chance anyone would want to use such terrible name
as CUSTOM_images
and I think he is responsible for the name (it's easy to grep) and
moreover if there would
be collision, it should work anyway, or not ?

Thanks for reviewing,
Matus


More information about the LibreOffice mailing list