* COMPILE (riece-compile-module): New function.
[riece] / lisp / COMPILE
index 99de9fd..11c2f6a 100644 (file)
@@ -7,10 +7,12 @@
                'riece-emacs)
              '(riece-globals
                riece-options
+               riece-debug
                riece-version
                riece-coding
                riece-complete
                riece-addon
+               riece-ruby
 
                riece-mode
                ;; riece-identity -+-> riece-channel
                riece-kakasi
                riece-yank
                riece-toolbar
-               riece-eval))))
+               riece-eval
+               riece-google
+               riece-keepalive
+               riece-eval-ruby))))
 
 (defvar riece-icons
-  '(riece-command-previous-channel
-    riece-command-next-channel))
+  '("riece-command-quit.xpm"
+    "riece-command-join.xpm"
+    "riece-command-part.xpm"
+    "riece-command-previous-channel.xpm"
+    "riece-command-next-channel.xpm"
+    "riece-command-change-layout.xpm"
+    "riece-submit-bug-report.xpm"))
+
+(defvar riece-scripts
+  '("server.rb"
+    "aproxy.rb"))
 
 (defun riece-compile-modules (modules)
-  (let ((load-path (cons nil load-path)))
+  (let ((load-path (cons nil load-path))
+       error-modules)
     (while modules
       (let ((source (expand-file-name
                     (concat (symbol-name (car modules)) ".el"))))
        (if (file-newer-than-file-p source (concat source "c"))
            (condition-case error
                (byte-compile-file source)
-             (error))))
-      (setq modules (cdr modules)))))
+             (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 riece-compile-module ()
+  (let ((load-path (cons nil load-path)))
+    (let ((source (expand-file-name
+                  (concat (car command-line-args-left) ".el"))))
+      (if (file-newer-than-file-p source (concat source "c"))
+         (byte-compile-file source)))))
 
 (defun riece-install-modules (modules dest just-print)
   (unless (or just-print (file-exists-p dest))
   (unless (or just-print (file-exists-p dest))
     (make-directory dest t))
   (while icons
-    (let ((name (symbol-name (car icons))))
-      (princ (format "%s.xpm -> %s\n" name dest))
+    (when (file-exists-p (expand-file-name (car icons)))
+      (princ (format "%s -> %s\n" (car icons) dest))
       (unless just-print
-       (copy-file (expand-file-name (concat name ".xpm"))
-                  (expand-file-name (concat name ".xpm") dest)
+       (copy-file (expand-file-name (car icons))
+                  (expand-file-name (car icons) dest)
                   t t)))
     (setq icons (cdr icons))))
 
+(defun riece-install-scripts (scripts dest just-print)
+  (unless (or just-print (file-exists-p dest))
+    (make-directory dest t))
+  (while scripts
+    (when (file-exists-p (expand-file-name (car scripts)))
+      (princ (format "%s -> %s\n" (car scripts) dest))
+      (unless just-print
+       (copy-file (expand-file-name (car scripts))
+                  (expand-file-name (car scripts) dest)
+                  t t)))
+    (setq scripts (cdr scripts))))
+
 (defun riece-install-just-print-p ()
   (let ((flag (getenv "MAKEFLAGS"))
        case-fold-search)
     (if flag
        (string-match "^\\(\\(--[^ ]+ \\)+-\\|[^ =-]\\)*n" flag))))
 
+(defun riece-examine ()
+  (princ (mapconcat #'symbol-name riece-modules " ")))
+
 (defun riece-compile ()
   (riece-compile-modules riece-modules))
 
   (riece-install-icons
    riece-icons
    (expand-file-name "riece" (car command-line-args-left))
+   (riece-install-just-print-p))
+  (riece-install-scripts
+   riece-scripts
+   (expand-file-name "riece" (car command-line-args-left))
    (riece-install-just-print-p)))
 
 (defun riece-compile-package ()
    (riece-install-just-print-p))
   (riece-install-icons
    riece-icons
+   (expand-file-name "riece"
+                    (expand-file-name "lisp" (car command-line-args-left)))
+   (riece-install-just-print-p))
+  (riece-install-scripts
+   riece-scripts
    (expand-file-name "riece"
                     (expand-file-name "lisp" (car command-line-args-left)))
    (riece-install-just-print-p)))