[GRASS-dev] installing metadata addon fails

Glynn Clements glynn at gclements.plus.com
Sat Jan 10 13:28:18 PST 2015


Moritz Lennert wrote:

> > 2015-01-08 16:37 GMT+01:00 Paulo van Breugel <p.vanbreugel at gmail.com>:
> >> The installation of the metadata addon on GRASS 7 (trunk) fails, with the
> >> message below. Any ideas?
> >
> > I have fixed installation in r63999-64001.
> 
> Is there some documentation about how to write Makefiles for addons that 
> use several .py files ? Similar issues have come up with different 
> addons (cf #2480 and #2534) and it shouldn't be up to you to correct all 
> these issues. Maybe some clear doc could help ?

The "documentation" for writing Makefiles boils down to: try to find
something similar in the main GRASS tree and use its Makefile as a
reference; if there isn't one, or if that doesn't work, ask on the
developers' list.

Writing documentation for this will result in either wasted effort
(from describing situations which never actually happen) or inadequate
documentation (from failing to describe situations which actually
happen) or (most likely) both.

A couple of points about wx.metadata specifically:

1. Using "parsubdirs" won't work as, because mdlib (presumably) needs
to be built before any of the modules.

2. Files should not be installed using "cp"; use $(INSTALL) for
anything which should be installed with execute permission or
$(INSTALL_DATA) for anything without it.

3. Directories shouldn't be copied with "cp -r". Rather, the
individual destination files should be listed as pre-requisites, so
that "building" the target "builds" the destination files (typically
via pattern rules).

wx.metadata/Makefile should probably include "templates" and "config"
in $(SUBDIRS). These would have their own Makefiles; e.g. for
templates/Makefile, something like:

	include $(MODULE_TOPDIR)/include/Make/Other.make

	DSTDIR = $(ETC)/mdlib/templates
	
	SRCFILES := $(wildcard *.xml)
	DSTFILES := $(patsubst %.xml,$(DSTDIR)/%.xml,$(SRCFILES))
	
	default: $(DSTFILES)
	
	$(DSTDIR)/%.xml: %.xml:
		$(INSTALL_DATA) $< $@

This should allow wx.metadata/Makefile to be a simple "directory"
Makefile (i.e. set SUBDIRS, include Dir.make, "default: subdirs").

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


More information about the grass-dev mailing list