-
Notifications
You must be signed in to change notification settings - Fork 10
/
APEL-MK
133 lines (114 loc) · 3.7 KB
/
APEL-MK
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
;;; -*-Emacs-Lisp-*-
;; APEL-MK: installer for APEL.
;;; Code:
(defun install-just-print-p ()
(let ((flag (getenv "MAKEFLAGS"))
case-fold-search)
(princ (format "%s\n" flag))
(if flag
(string-match "^\\(\\(--[^ ]+ \\)+-\\|[^ =-]\\)*n" flag)
)))
(defun install-update-package-files (package dir &optional just-print)
(cond (just-print
(princ (format "Updating autoloads in directory %s..\n\n" dir))
(princ (format "Processing %s\n" dir))
(princ "Generating custom-load.el...\n\n")
(princ (format "Compiling %s...\n"
(expand-file-name "auto-autoloads.el" dir)))
(princ (format "Wrote %s\n"
(expand-file-name "auto-autoloads.elc" dir)))
(princ (format "Compiling %s...\n"
(expand-file-name "custom-load.el" dir)))
(princ (format "Wrote %s\n"
(expand-file-name "custom-load.elc" dir)))
)
(t
(setq autoload-package-name package)
(add-to-list 'command-line-args-left dir)
(batch-update-directory)
(add-to-list 'command-line-args-left dir)
(Custom-make-dependencies)
(byte-compile-file (expand-file-name "auto-autoloads.el" dir))
(byte-compile-file (expand-file-name "custom-load.el" dir))
)))
(defun config-apel ()
(let (prefix lisp-dir version-specific-lisp-dir)
(and (setq prefix (car command-line-args-left))
(or (string-equal "NONE" prefix)
(defvar PREFIX prefix)
))
(setq command-line-args-left (cdr command-line-args-left))
(and (setq lisp-dir (car command-line-args-left))
(or (string-equal "NONE" lisp-dir)
(defvar LISPDIR lisp-dir)
))
(setq command-line-args-left (cdr command-line-args-left))
(and (setq version-specific-lisp-dir (car command-line-args-left))
(or (string-equal "NONE" version-specific-lisp-dir)
(progn
(defvar VERSION_SPECIFIC_LISPDIR version-specific-lisp-dir)
(princ (format "VERSION_SPECIFIC_LISPDIR=%s\n"
VERSION_SPECIFIC_LISPDIR)))
))
(setq command-line-args-left (cdr command-line-args-left))
(load-file "APEL-CFG")
(or (boundp 'apel-modules)
(load-file "APEL-ELS")
)
(princ (format "PREFIX=%s\n" PREFIX))
))
(defun compile-apel ()
(config-apel)
(load-file "EMU-ELS")
(load-file "APEL-ELS")
(compile-elisp-modules emu-modules ".")
(compile-elisp-modules apel-modules ".")
)
(defun install-apel ()
(compile-apel)
(let ((just-print (install-just-print-p)))
(install-elisp-modules emu-modules "." EMU_DIR just-print)
(install-elisp-modules apel-modules "." APEL_DIR just-print)
))
(defun config-apel-package ()
(let (package-dir)
(and (setq package-dir (car command-line-args-left))
(or (string= "NONE" package-dir)
(defvar PACKAGEDIR package-dir)
))
(setq command-line-args-left (cdr command-line-args-left))
(load-file "APEL-CFG")
(load-file "APEL-ELS")
(load-file "EMU-ELS")
(princ (format "PACKAGEDIR=%s\n" PACKAGEDIR))
))
(defun compile-apel-package ()
(config-apel-package)
(compile-elisp-modules emu-modules ".")
(compile-elisp-modules apel-modules ".")
)
(defun install-apel-package ()
(config-apel-package)
(let ((just-print (install-just-print-p))
(dir (expand-file-name APEL_PREFIX
(expand-file-name "lisp" PACKAGEDIR))))
(install-elisp-modules emu-modules "." dir just-print)
(install-elisp-modules apel-modules "." dir just-print)
(install-update-package-files "apel" dir just-print)
))
(defun what-where-apel ()
(config-apel)
(load-file "EMU-ELS")
(princ (format "
The files that belong to the EMU modules:
%s
-> %s
The files that belong to the APEL modules:
%s
-> %s
"
(mapconcat 'symbol-name emu-modules ", ")
EMU_DIR
(mapconcat 'symbol-name apel-modules ", ")
APEL_DIR)))
;;; APEL-MK ends here