Roland Ver. 4.5 Informações Técnicas Página 172

  • Descarregar
  • Adicionar aos meus manuais
  • Imprimir
  • Página
    / 212
  • Índice
  • MARCADORES
  • Avaliado. / 5. Com base em avaliações de clientes
Vista de página 171
162 GNU make
installdirs
It’s useful to add a target named installdirs to create the directories
where files are installed, and their parent directories. There is a script called
mkinstalldirs which is convenient for this; you can find it in the Gnulib
package. You can use a rule like this:
# Make sure all installation directories (e.g. $(bindir))
# actually exist by making them if necessary.
installdirs: mkinstalldirs
$(srcdir)/mkinstalldirs $(bindir) $(datadir) \
$(libdir) $(infodir) \
$(mandir)
or, if you wish to support DESTDIR (strongly encouraged),
# Make sure all installation directories (e.g. $(bindir))
# actually exist by making them if necessary.
installdirs: mkinstalldirs
$(srcdir)/mkinstalldirs \
$(DESTDIR)$(bindir) $(DESTDIR)$(datadir) \
$(DESTDIR)$(libdir) $(DESTDIR)$(infodir) \
$(DESTDIR)$(mandir)
This rule should not modify the directories where compilation is done. It should
do nothing but create installation directories.
15.7 Install Command Categories
When writing the install target, you must classify all the commands into three categories:
normal ones, pre-installation commands and post-installation commands.
Normal commands move files into their proper places, and set their modes. They may
not alter any files except the ones that come entirely from the package they belong to.
Pre-installation and post-installation commands may alter other files; in particular, they
can edit global configuration files or data bases.
Pre-installation commands are typically executed before the normal commands, and
post-installation commands are typically run after the normal commands.
The most common use for a post-installation command is to run install-info. This
cannot be done with a normal command, since it alters a file (the Info directory) which
does not come entirely and solely from the package being installed. It is a post-installation
command because it needs to be done after the normal command which installs the package’s
Info files.
Most programs don’t need any pre-installation commands, but we have the feature just
in case it is needed.
To classify the commands in the install rule into these three categories, insert category
lines among them. A category line specifies the category for the commands that follow.
A category line consists of a tab and a reference to a special Make variable, plus an
optional comment at the end. There are three variables you can use, one for each category;
the variable name specifies the category. Category lines are no-ops in ordinary execution
because these three Make variables are normally undefined (and you should not define them
in the makefile).
Here are the three possible category lines, each with a comment that explains what it
means:
Vista de página 171
1 2 ... 167 168 169 170 171 172 173 174 175 176 177 ... 211 212

Comentários a estes Manuais

Sem comentários