(eval-and-compile): Moved from poe.el.
[elisp/apel.git] / APEL-MK
1 ;;; -*-Emacs-Lisp-*-
2
3 ;; APEL-MK: installer for APEL.
4
5 ;;; Code:
6
7 (defun config-apel ()
8   (let (prefix lisp-dir version-specific-lisp-dir)
9     (and (setq prefix (car command-line-args-left))
10          (or (string-equal "NONE" prefix)
11              (defvar PREFIX prefix)
12              ))
13     (setq command-line-args-left (cdr command-line-args-left))
14     (and (setq lisp-dir (car command-line-args-left))
15          (or (string-equal "NONE" lisp-dir)
16              (defvar LISPDIR lisp-dir)
17              ))
18     (setq command-line-args-left (cdr command-line-args-left))
19     (and (setq version-specific-lisp-dir (car command-line-args-left))
20          (or (string-equal "NONE" version-specific-lisp-dir)
21              (progn
22                (defvar VERSION_SPECIFIC_LISPDIR version-specific-lisp-dir)
23                (princ (format "VERSION_SPECIFIC_LISPDIR=%s\n"
24                               VERSION_SPECIFIC_LISPDIR)))
25              ))
26     (setq command-line-args-left (cdr command-line-args-left))
27     (load-file "APEL-CFG")
28     (or (boundp 'apel-modules)
29         (load-file "APEL-ELS")
30         )
31     (princ (format "PREFIX=%s\n" PREFIX))
32     ))
33
34 (defun compile-apel ()
35   (config-apel)
36   (load "EMU-ELS")
37   (load-file "APEL-ELS")
38   (compile-elisp-modules emu-modules    ".")
39   (compile-elisp-modules apel-modules   ".")
40   )
41
42 (defun install-apel ()
43   (compile-apel)
44   (install-elisp-modules emu-modules    "."     EMU_DIR)
45   (install-elisp-modules apel-modules   "."     APEL_DIR)
46   )
47
48 (defun config-apel-package ()
49   (let (package-dir)
50     (and (setq package-dir (car command-line-args-left))
51          (or (string= "NONE" package-dir)
52              (defvar PACKAGEDIR package-dir)
53              ))
54     (setq command-line-args-left (cdr command-line-args-left))
55     (load-file "APEL-CFG")
56     (load-file "APEL-ELS")
57                                           
58     (princ (format "PACKAGEDIR=%s\n" PACKAGEDIR))
59     ))
60
61 (defun install-apel-package ()
62   (config-apel-package)
63   (load "EMU-ELS")
64   
65   (compile-elisp-modules emu-modules    ".")
66   (compile-elisp-modules apel-modules   ".")
67   
68   (let ((dir (expand-file-name APEL_PREFIX
69                                (expand-file-name "lisp"
70                                                  PACKAGEDIR))))
71     (install-elisp-modules emu-modules  "." dir)
72     (install-elisp-modules apel-modules "." dir)
73     
74     (setq autoload-package-name "apel")
75     (add-to-list 'command-line-args-left dir)
76     (batch-update-directory)
77
78     (add-to-list 'command-line-args-left dir)
79     (Custom-make-dependencies)
80
81     (byte-compile-file (expand-file-name "auto-autoloads.el" dir))
82     (byte-compile-file (expand-file-name "custom-load.el" dir))
83     ))
84
85 (defun what-where-apel ()
86   (config-apel)
87   (load "EMU-ELS")
88   (princ (format "
89 The files that belong to the EMU modules:
90   %s
91   -> %s
92
93 The files that belong to the APEL modules:
94   %s
95   -> %s
96 "
97                  (mapconcat 'symbol-name emu-modules ", ")
98                  EMU_DIR
99                  (mapconcat 'symbol-name apel-modules ", ")
100                  APEL_DIR)))
101
102 ;;; APEL-MK ends here