;;; -*- Emacs-Lisp -*- (defvar mixi-modules '(@MODULES@)) (defun mixi-compile-modules (modules) (let ((load-path (cons nil load-path)) error-modules) (while modules (let ((source (expand-file-name (symbol-name (car modules))))) (if (file-newer-than-file-p source (concat source "c")) (condition-case error (byte-compile-file source) (error (setq error-modules (cons (car modules) error-modules)))))) (setq modules (cdr modules))) (if error-modules (princ (concat "\n\ WARNING: --------------------------------------------------------- WARNING: Couldn't compile following modules: WARNING: WARNING: " (mapconcat #'symbol-name error-modules ", ") "\n\ WARNING: WARNING: You should probably stop here, try \"make distclean\" to clear WARNING: the last build, and then reconfigure. WARNING: ---------------------------------------------------------\n\n"))))) (defun mixi-compile-module () (let ((load-path (cons nil load-path))) (let ((source (expand-file-name (car command-line-args-left)))) (if (file-newer-than-file-p source (concat source "c")) (byte-compile-file source))))) (defun mixi-install-modules (modules dest just-print) (unless (or just-print (file-exists-p dest)) (make-directory dest t)) (while modules (let ((name (symbol-name (car modules)))) (princ (format "%s -> %s\n" name dest)) (unless just-print (copy-file (expand-file-name name) (expand-file-name name dest) t t)) (princ (format "%sc -> %s\n" name dest)) (unless just-print (if (file-exists-p (expand-file-name (concat name "c"))) (copy-file (expand-file-name (concat name "c")) (expand-file-name (concat name "c") dest) t t) (princ (format "(%s was not successfully compiled, ignored)\n" name))))) (setq modules (cdr modules)))) (defun mixi-install-just-print-p () (let ((flag (getenv "MAKEFLAGS")) case-fold-search) (if flag (string-match "^\\(\\(--[^ ]+ \\)+-\\|[^ =-]\\)*n" flag)))) (defun mixi-examine () (princ (mapconcat #'symbol-name mixi-modules " "))) (defun mixi-compile () (mixi-compile-modules mixi-modules)) (defun mixi-install () (mixi-install-modules mixi-modules (expand-file-name "mixi" (car command-line-args-left)) (mixi-install-just-print-p))) (defun mixi-compile-package () (setq autoload-package-name "mixi") (add-to-list 'command-line-args-left ".") (batch-update-directory) (add-to-list 'command-line-args-left ".") (Custom-make-dependencies) (mixi-compile-modules (append mixi-modules '(auto-autoloads.el custom-load.el)))) (defun mixi-install-package () (mixi-install-modules (append mixi-modules '(auto-autoloads.el custom-load.el)) (expand-file-name "lisp/mixi" (car command-line-args-left)) (mixi-install-just-print-p)))