~ubuntu-branches/debian/wheezy/elib/wheezy

« back to all changes in this revision

Viewing changes to elib-compile-all.el

  • Committer: Bazaar Package Importer
  • Author(s): Tom Lees
  • Date: 1999-11-02 20:11:21 UTC
  • Revision ID: james.westby@ubuntu.com-19991102201121-5c9qk1x32usb6v4s
Tags: upstream-1.0
ImportĀ upstreamĀ versionĀ 1.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
;;;; $Id: elib-compile-all.el,v 0.10 1995/12/11 00:11:17 ceder Exp $
 
2
;;;; This file byte-compiles all .el files in elib.
 
3
 
 
4
;; Copyright (C) 1991-1995 Free Software Foundation
 
5
 
 
6
;; Author: Per Cederqvist <ceder@lysator.liu.se>
 
7
;;      Inge Wallin <inge@lysator.liu.se>
 
8
;; Maintainer: elib-maintainers@lysator.liu.se
 
9
;; Created: 14 Mar 1992
 
10
 
 
11
;;;; This file is part of the GNU Emacs lisp library, Elib.
 
12
;;;;
 
13
;;;; GNU Elib is free software; you can redistribute it and/or modify
 
14
;;;; it under the terms of the GNU General Public License as published by
 
15
;;;; the Free Software Foundation; either version 2, or (at your option)
 
16
;;;; any later version.
 
17
;;;;
 
18
;;;; GNU Elib is distributed in the hope that it will be useful,
 
19
;;;; but WITHOUT ANY WARRANTY; without even the implied warranty of
 
20
;;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
21
;;;; GNU General Public License for more details.
 
22
;;;;
 
23
;;;; You should have received a copy of the GNU General Public License
 
24
;;;; along with GNU Elib; see the file COPYING.  If not, write to
 
25
;;;; the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
 
26
;;;; Boston, MA 02111-1307, USA
 
27
;;;;
 
28
 
 
29
;;; Code:
 
30
 
 
31
(setq elib-files '("stack-f"
 
32
                   "stack-m"
 
33
                   "queue-f"
 
34
                   "queue-m"
 
35
                   "elib-node"
 
36
                   "dll"
 
37
                   "dll-debug"
 
38
                   "bintree"
 
39
                   "avltree"
 
40
                   "cookie"
 
41
                   "string"
 
42
                   "read"))
 
43
 
 
44
 
 
45
(defun compile-file-if-necessary (file)
 
46
  "Compile the Elib file FILE if necessary.
 
47
 
 
48
This is done if FILE.el is newer than FILE.elc or if FILE.elc doesn't exist."
 
49
  (let ((el-name (concat file ".el"))
 
50
        (elc-name (concat file ".elc")))
 
51
    (if (or (not (file-exists-p elc-name))
 
52
            (file-newer-than-file-p el-name elc-name))
 
53
        (progn
 
54
          (message (format "Byte-compiling %s..." el-name))
 
55
          (byte-compile-file el-name)))))
 
56
 
 
57
 
 
58
(defun compile-elib ()
 
59
  "Byte-compile all uncompiled files of elib."
 
60
 
 
61
  ;; Be sure to have . in load-path since a number of files in elib
 
62
  ;; depend on other files and we always want the newer one even if
 
63
  ;; a previous version of elib exists.
 
64
 
 
65
  (interactive)
 
66
  (let ((load-path (append '(".") load-path)))
 
67
    (mapcar (function compile-file-if-necessary)
 
68
            elib-files)))
 
69
 
 
70
;; elib-compile-all.el ends here