Class Mkmf2::MfEntity
In: mkmf2.rb
Parent: Object

An MfEntity object reprensents something that is part of the package. In this way, it needs to provide:

  • a way to install itself;
  • a way to uninstall itself;
  • a way to clean the source directory;
  • and, possibly, a way to build itself.

This class should be subclassed for objects that need building. It should be enough though for many simple objects.

The module will hold a list of all the MfEntities, and use them in turn to create the Makefile.



install_files  [RW]  install_files is a hash that associates files in the building tree to files where the installation is done. To be more precise the install path for the files is expressed relative to install_path
install_rule  [RW]  It is used to ask Mkmf2.install_files for the right rule for installing files (they can be data, scripts, programs, and so on…)
kind  [RW]  It represents the type of the entity. It should be a valid entry for Mkmf2.install_path.
name  [RW]  This name has to be registered by Mkmf2.register_name. Its lowercase version will be used to name the targets (install_#{name}), etc.), and it’s uppercase version can be used as a prefix to name Makefile variables, that we can for instance depend on.

Public Class methods

The name parameter is turned into a unique name and ends up as an identifier for the stuffs related to this element in the Makefile. The install parameter directly becomes install_files. The kind parameter describes the kind of thing we’re going to install. See Mkmf2.install_path.

Public Instance methods

Rules for building the entity. See install_rules for an explanation about return values.

Rules for cleaning the source directory. See install_rules for an explanation about return values. This implementation does nothing, as there is nothing to be built.

Returns the install path for the current object. The implementation should call Mkmf2.install_path with an appropriate argument.

Returns an array containing

  • a string as the first element which should be appendended as a dependency for the install target
  • a set of MfRules, describing what need to be done for that peculiar install.

Rules for uninstalling the entity. See install_rules for the return values.

Returns all the variables that should be added to the Makefile. It should return a simple hash containing the values.