| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
automake file: the complexity is hidden in
generic rules files, in this case the `XEmacs.rules' include file
in the top directory of the packages hierarchy.
It is important to note that the XEmacs used to compile packages is the bare minimum: it is called with the `-no-autoloads'. This means that anything not dumped into XEmacs by default needs to be specified in the `REQUIRES' variable (for packaged Lisp) or in some cases the `PRELOADS' (autoloads used in libraries mentioned in `PRELOADS').
There isn't much to an XEmacs Packaging System `Makefile', basically it just contains a few `Makefile' variables and that's it. See the example.
Here is a real world example, from the `build' package:
# Makefile for build lisp code # This file is part of XEmacs. # # XEmacs is free software: you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by the # Free Software Foundation, either version 3 of the License, or (at your # option) any later version. # # XEmacs is distributed in the hope that it will be useful, but WITHOUT # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License # for more details. # # You should have received a copy of the GNU General Public License # along with XEmacs. If not, see <http://www.gnu.org/licenses/>. # For the time being, remove MULE_ELCS from the all dependencies if # building without Mule. VERSION = 1.10 AUTHOR_VERSION = 2.02 MAINTAINER = Adrian Aichner <adrian@xemacs.org> PACKAGE = build PKG_TYPE = regular REQUIRES = xemacs-base pcl-cvs dired w3 prog-modes CATEGORY = standard ELCS = build.elc build-report.elc STANDARD_DOCS = t include ../../XEmacs.rules |
Most packages don't need any more than what you see above. It is usually not necessary to specify any special `Makefile' rules. Everything is handled from the `*.rules' files in the toplevel of the package source hierarchy.
Of course, with that said, there are always exceptions to the rule. If you think that your package will need some special `Makefile' hackery contact the XEmacs developers. We distribute over 100 packages so the chances are good that you won't be the first to need such hackery and it is probably already catered for.
The required variables are described in the table below. The corresponding field names for `package-info.in', where relevant, are given in parentheses.
N.B. `single-file' here does not refer to the number of lisp files in a package. See section Package Terminology:.
Note that the usual form in `package-info.in' already has the parentheses, so the `make' variable should be set to a space-separated list of package names not enclosed in parentheses.
The list is of packages, not libraries, as would
ordinarily be provided to the Lisp require function.
`REQUIRES' cannot be correctly computed from the calls to
require in the package's library sources. `REQUIRES' is
used to ensure that all macro and defstruct definitions used by the
package are available at build time. This is not merely a matter of
efficiency, to get the expansions inlined. In fact, it is
impossible to call a macro by name in byte-compiled Emacs Lisp
code. Thus, if the macro expansion is not inlined, the call will result
in an error at run-time! Thus, packages providing libraries that would
be loaded because of autoload definitions must also be included.
Note there is no sanity-checking done on this variable. If you put `.el' files in here, they will not be compiled and they will be deleted by `make clean'. You would surely be very distressed if that happened, so be very careful. If this variable is left empty, none of your Lisp code will be compiled or packaged. This would be a less than amusing surprise, too.
We don't consider this a feature, of course. Please do submit code to do sanity checking to xemacs-patches@xemacs.org.
Optional, but commonly used variables are explained below.
ELCS in regard to
make clean.
ELCS_1 files to be installed
to. Be sure to include `$(PACKAGE)/' as part of the name.
ELCS_1_DEST = $(PACKAGE)/extra |
Would put the ELCS_1 files for the package, `foo' into
`xemacs-packages/lisp/foo/extra/'.
PRELOADS=-l ./apackage-macros.el -l ../bpackage/lisp/bpackage-macros.el |
Preloads are loaded before `package-compile.el', so the
load-path is minimal. Therefore `PRELOADS' must specify a
full path to packaged Lisp. The base load-path does include the
core Lisp directory, so core libraries are found.
N.B. There is no need to use this variable if the `.el'
files are in the package's toplevel directory. AUTOLOAD_PATH
defaults to `.'.
package-suppress here to indicate Lisp libraries
that should only be available to particular versions of XEmacs. For
example:
PACKAGE_SUPPRESS = \ (package-suppress 'xemacs-base \"regexp-opt\" '(emacs-version>= 21 5 11)) \ (package-suppress 'xemacs-base \"easy-mmode\" '(emacs-version>= 21 5 11)) |
N.B. This feature has not yet been implemented in XEmacs yet. It will appear in an upcoming version of XEmacs 21.5.
EXPLICIT_DOCS = texi/$(PACKAGE).texi |
See DOCS_TXI_EXTENSION and DOCS_TEXINFO_EXTENSION if you
don't use the `.texi' file extension on your Texinfo sources.
makeinfo
as a dependency.
DATA_FILES are installed to. It
is a subdirectory of the installed `etc/' directory. Be sure to
prefix this value with `$(PACKAGE)', for example:
DATA_DEST = $(PACKAGE)/foo |
Would put files into `.../etc/$(PACKAGE)/foo/'.
DATA_DEST.
DATA_n_FILES. And like DATA_DEST, be sure to prefix
`$(PACKAGE)' to the value of these variables.
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
package-directory-map
cond in package-name-to-directory
This only needs to be done once, when the package is first added to the XEmacs Packaging System. (Well, when you randomly change the subdirectory layout, too.) Your changes to `package-compile.el' must be cleared and checked in by the XEmacs Package Release Engineer before your package will build correctly from a fresh checkout.
This is unfortunate; it works pretty well once set up, but can cause
confusion when first building a package in the XEmacs Packaging System context. In
particular, if the package-directory-map entry for a required
package, including the package itself, is not found, the necessary
requires will not be executed by `package-compile.el'. If
required functions are executed (under eval-when-compile),
they won't be found and the compile will fail. If required function
is actually a macro, the byte compiler will not recognize that,
compile a function call to the macro. This will cause a run-time
error because the byte-code interpreter does not know how to execute
macros. (Macros can always be expanded at compile-time, and this is
more efficient.)
If your package keeps some or all Lisp code somewhere other than the top
directory, then an entry in package-name-to-directory is also
necessary, or requires will fail, leading to the problems just described.
Some random notes on documenting your package.
Do write a Texinfo file. It's not that hard to do basically, and even using the more advanced features of Texinfo soon become natural. For a start, just grab the template `Samples/package.texi' from the XEmacs Packaging System source tree, and drop your current README into the Top node. At least this way your documentation will be accessible from the standard Info readers. Next, try to add lots of cross-referencing and logical markup, and then node structure.
Address both end users and developer issues. You may not be the maintainer forever.
If you are maintaining a package that is part of the GNU Emacs
distribution, you'll likely find that you occasionally synchronize your
package with the GNU Emacs sources. When you synch a file,
conventionally you should place a comment just above the standard
;;; Code comment that looks like this:
;; Synched with: ;; GNU Emacs 21.1, 2002-02-08, Stephen Turnbull <stephen@xemacs.org> |
This comment is a status flag; the ChangeLog doesn't really give the same information.
Do maintain a detailed ChangeLog.
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
To be completed.
| [ << ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |