[GRASS-dev] Standalone GUI modules: Makefile

Glynn Clements glynn at gclements.plus.com
Sun Nov 11 15:19:44 PST 2012


Vaclav Petras wrote:

> > 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).

Prefixes and suffixes can be added and removed easily enough, so
having g.gui.mapswipe.html and wxGUI.mapswipe.html is straightforward.

So if you have a subdirectory for modules, you could do e.g.:

MODULES := $(patsubst g.gui.%.py,%,$(wildcard g.gui.*.py))
CMDHTML := $(patsubst %,$(HTMLDIR)/g.gui.%.html,$(MODULES))
GUIHTML := $(patsubst %,$(HTMLDIR)/wgGUI.%.html,$(MODULES))
PYFILES := $(patsubst %,$(SCRIPTDIR)/g.gui.%,$(MODULES))

default: $(CMDHTML) $(GUIHTML) $(PYFILES)

$(HTMLDIR)/g.gui.%.html: g.gui.%.html g.gui.%.tmp.html | $(HTMLDIR)
	$(PYTHON) $(GISBASE)/tools/mkhtml.py g.gui.$* $(GRASS_VERSION_DATE) > $@

$(HTMLDIR)/wxGUI.%.html: g.gui.%.html | $(HTMLDIR)
	$(INSTALL_DATA) $< $@

g.gui.%.tmp.html: $(SCRIPTDIR)/g.gui.%.py
	$(call htmldesc,$<,$@)

$(SCRIPTDIR)/g.gui.%.py: g.gui.%.py | $(SCRIPTDIR)
	$(INSTALL) $< $@

-- 
Glynn Clements <glynn at gclements.plus.com>


More information about the grass-dev mailing list