[GRASS-dev] Standalone GUI modules: Makefile

Vaclav Petras wenzeslaus at gmail.com
Sun Nov 11 12:43:23 PST 2012


On 10 November 2012 19:22, Glynn Clements <glynn at gclements.plus.com> wrote:
>
> Vaclav Petras wrote:
>
>> Now, I'm asking for help with Makefile for this module. Martin helped
>> me a lot in identifying what has to be done and he prepared the
>> Makefile [2]. But this Makefile need to be generalized in order to
>> avoid code duplication. I'm not able to do it so I'm asking you to
>> help.
>
> If you want to avoid duplication, it would help to avoid giving each
> module two distinct names (e.g. g.gui.mapswipe and MapSwipe).
>
> A prefix or suffix can be handled easily enough, but the case
> conversion is more awkward. make doesn't have a function for case
> conversion, and using $(shell ...) is inefficient and relies upon the
> existence of a utility such as "tr".
>
> If one can't be generated automatically from the other, then we'd need
> to implement a table, as is done for library names in Grass.make.
> "mapswipe" can be generated from "MapSwipe" (at the cost of running an
> external command), but we can't do the reverse. Also, if one form uses
> camel-case while the other use underscores, it gets more complicated.
>
> Basically: how important is it for each module to have a WXPGM
> distinct from PGM?
>
Hmm, it is not so important. The main reason is that we need two
manual pages. One for module (g.gui.mapswipe.html) and one for
component (wxGUI.MapSwipe.html).

To simplify things, we can use name wxGUI.g.gui.mapswipe.html. But I
don't like "wxGUI.g.gui" part. Naming convention should lead to nice
names. wxGUI.mapswipe.html would be nice (mapswipe is also the
directory name).

Anyway, I thing that it is worth to have two manual pages (and thus
two identifiers), one for module and one for component integrated to
wxGUI. The later one is without the generated part so the user is not
disturbed by the command line things when he is using GUI. Another
argument for the GUI-only manual page is the list of wxGUI components
where are these components listed by their long (user visible) names
(Map Swipe).

In conclusion, I agree that translating one to another is too
complicated. However, we can give up the camel case (which is used
only in manual) and derive one name from another just by substitution
(PGM=g.gui.$WXPGM). In this case, we can have two identifiers for two
(similar but different) manual pages which are needed to satisfy all
users. And finally, if we agree on two manual pages, we need the rule
for the Makefile.

Vaclav


More information about the grass-dev mailing list