tm 7.39.
[elisp/tm.git] / mh-e / mk-tmh
1 ;;; -*-Emacs-Lisp-*-
2 ;;;
3 ;;; $Id: mk-tmh,v 2.0 1995/12/25 05:48:21 morioka Exp morioka $
4 ;;;
5
6 (setq load-path (append
7                  (mapcar (function
8                           (lambda (path)
9                             (expand-file-name path (getenv "PWD"))
10                             ))
11                          '("." ".." "../../tl/" "../../mel/")
12                          )
13                  load-path))
14
15 (require 'mh-e)
16 (require 'emu)
17
18 (setq tm-mh-e-modules
19       (append
20        '("tm-mh-e")
21        (if (not (boundp 'mh-e-version))
22            '("tm-mh-e3")
23          )
24        ))
25
26 (setq tm-mh-e-el-files
27       (mapcar (function (lambda (module)
28                           (concat module ".el")
29                           ))
30               tm-mh-e-modules))
31
32 (setq tm-mh-e-elc-files
33       (mapcar (function (lambda (module)
34                           (concat module ".elc")
35                           ))
36               tm-mh-e-modules))
37
38 (defun compile-tm-mh-e ()
39   (require 'tm-mh-e)
40   (require 'mh-comp)
41   (require 'tm-edit)
42   (mapcar (function byte-compile-file) tm-mh-e-el-files)
43   )
44
45 (defconst el-file-mode (+ (* 64 6)(* 8 4) 4))
46
47 (defun install-el (path file)
48   (let ((full-path (expand-file-name file path)))
49     (if (file-exists-p full-path)
50         (set-file-modes full-path el-file-mode)
51       )
52     (copy-file file full-path t t)
53     (princ (format "%s -> %s\n" file path))
54     ))
55
56 (defun install-el-files (path &rest files)
57   (mapcar (function (lambda (file)
58                       (if (file-exists-p file)
59                           (install-el path file)
60                         )))
61           files))
62
63 (defun install-elc (path file)
64   (let ((full-path (expand-file-name file path)))
65     (copy-file file full-path t t)
66     (delete-file file)
67     (princ (format "%s -> %s\n" file path))
68     ))
69
70 (defun install-elc-files (path &rest files)
71   (mapcar (function (lambda (file)
72                       (if (file-exists-p file)
73                           (install-elc path file)
74                         )))
75           files))
76
77 (defun install-tm-mh-e ()
78   (let ((path (car command-line-args-left)))
79     (princ (format "%s\n" emacs-version))
80     (if (not (file-exists-p path))
81         (make-directory path t)
82       )
83     (apply (function install-el-files) path tm-mh-e-el-files)
84     (apply (function install-elc-files) path tm-mh-e-elc-files)
85     (setq command-line-args-left (cdr command-line-args-left))
86     ))