To install datafiles from your
Makefile.am you simply come up with a name for the
install target---pixmap
seems good---then create a variable for the directory
and a corresponding variable for the files to install
there. For example:
EXTRA_DIST = gnome-hello-logo.png
pixmapdir = $(datadir)/pixmaps
pixmap_DATA = gnome-hello-logo.png
|
The "pixmap" string
connects the pixmapdir
variable with the
pixmap_DATA variable.
automake interprets the
_DATA suffix and generates appropriate rules in
Makefile.in. This Makefile.am segment installs gnome-hello-logo.png into $(datadir)/pixmaps; $(datadir) is a variable filled in
by configure. Typically $(datadir) is /usr/local/share (more precisely,
$(prefix)/share), which is
the standard location for architecture-independent data
files (that is, files which can be shared between
several systems with different binary file formats).
the section called
EXTRA_DIST
describes the EXTRA_DIST
variable.
The standard location for Gnome pixmaps is $(datadir)/pixmaps, so we used that
in the example. The Gnome Project encourages the use of
PNG format for all pixmaps; this format is supported by
gdk_imlib, the Gnome
image-loading library. It is also small, fast, and
unencumbered by patents.