]> code.delx.au - gnu-emacs/blobdiff - lisp/cedet/ede/proj-comp.el
Merge from origin/emacs-24
[gnu-emacs] / lisp / cedet / ede / proj-comp.el
index 418e70fd5e9520905392dcc44d83bdb47ea82fdf..87eae6cb1c022667fee4734980bb97d33c2d9887 100644 (file)
@@ -1,7 +1,7 @@
 ;;; ede/proj-comp.el --- EDE Generic Project compiler/rule driver
 
-;; Copyright (C) 1999-2001, 2004-2005, 2007, 2009-2011
-;;   Free Software Foundation, Inc.
+;; Copyright (C) 1999-2001, 2004-2005, 2007, 2009-2015 Free Software
+;; Foundation, Inc.
 
 ;; Author: Eric M. Ludlam <zappo@gnu.org>
 ;; Keywords: project, make
@@ -83,7 +83,7 @@ For example, yacc/lex files need additional chain rules, or inferences.")
            :documentation
            "The commands used to execute this compiler.
 The object which uses this compiler will place these commands after
-it's rule definition.")
+its rule definition.")
    (autoconf :initarg :autoconf
             :initform nil
             :type list
@@ -97,8 +97,8 @@ use the same autoconf form.")
    (objectextention :initarg :objectextention
                    :type string
                    :documentation
-                   "A string which is the extention used for object files.
-For example, C code uses .o on unix, and Emacs Lisp uses .elc.")
+                   "A string which is the extension used for object files.
+For example, C code uses .o on Unix, and Emacs Lisp uses .elc.")
    )
   "A program used to compile or link a program via a Makefile.
 Contains everything needed to output code into a Makefile, or autoconf
@@ -149,7 +149,7 @@ belonging to the target name.")
          :type list
          :custom (repeat string)
          :documentation "Scripts to execute.
-These scripst will be executed in sh (Unless the SHELL variable is overriden).
+These scripts will be executed in sh (Unless the SHELL variable is overridden).
 Do not prefix with TAB.
 Each individual element of this list can be either a string, or
 a lambda function.  (The custom element does not yet express that.")
@@ -173,12 +173,12 @@ Adds this rule to a .PHONY list."))
 This is used when creating a Makefile to prevent duplicate variables and
 rules from being created.")
 
-(defmethod initialize-instance :AFTER ((this ede-compiler) &rest fields)
+(cl-defmethod initialize-instance :after ((this ede-compiler) &rest fields)
   "Make sure that all ede compiler objects are cached in
 `ede-compiler-list'."
   (add-to-list 'ede-compiler-list this))
 
-(defmethod initialize-instance :AFTER ((this ede-linker) &rest fields)
+(cl-defmethod initialize-instance :after ((this ede-linker) &rest fields)
   "Make sure that all ede compiler objects are cached in
 `ede-linker-list'."
   (add-to-list 'ede-linker-list this))
@@ -218,7 +218,7 @@ This will prevent rules from creating duplicate variables or rules."
            (def-edebug-spec ede-pmake-insert-variable-shared (form def-body))
            ))
 
-;;; Querys
+;;; Queries
 (defun ede-proj-find-compiler (compilers sourcetype)
   "Return a compiler from the list COMPILERS that will compile SOURCETYPE."
   (while (and compilers
@@ -235,8 +235,8 @@ This will prevent rules from creating duplicate variables or rules."
   (car-safe linkers))
 
 ;;; Methods:
-(defmethod ede-proj-tweak-autoconf ((this ede-compilation-program))
-  "Tweak the configure file (current buffer) to accomodate THIS."
+(cl-defmethod ede-proj-tweak-autoconf ((this ede-compilation-program))
+  "Tweak the configure file (current buffer) to accommodate THIS."
   (mapcar
    (lambda (obj)
      (cond ((stringp obj)
@@ -247,8 +247,8 @@ This will prevent rules from creating duplicate variables or rules."
      )
    (oref this autoconf)))
 
-(defmethod ede-proj-flush-autoconf ((this ede-compilation-program))
-  "Flush the configure file (current buffer) to accomodate THIS."
+(cl-defmethod ede-proj-flush-autoconf ((this ede-compilation-program))
+  "Flush the configure file (current buffer) to accommodate THIS."
   nil)
 
 (defmacro proj-comp-insert-variable-once (varname &rest body)
@@ -263,7 +263,7 @@ Execute BODY in a location where a value can be placed."
      ))
 (put 'proj-comp-insert-variable-once 'lisp-indent-function 1)
 
-(defmethod ede-proj-makefile-insert-variables ((this ede-compilation-program))
+(cl-defmethod ede-proj-makefile-insert-variables ((this ede-compilation-program))
   "Insert variables needed by the compiler THIS."
   (if (eieio-instance-inheritor-slot-boundp this 'variables)
       (with-slots (variables) this
@@ -276,19 +276,19 @@ Execute BODY in a location where a value can be placed."
                 (insert cd)))))
         variables))))
 
-(defmethod ede-compiler-intermediate-objects-p ((this ede-compiler))
+(cl-defmethod ede-compiler-intermediate-objects-p ((this ede-compiler))
   "Return non-nil if THIS has intermediate object files.
 If this compiler creates code that can be linked together,
 then the object files created by the compiler are considered intermediate."
   (oref this uselinker))
 
-(defmethod ede-compiler-intermediate-object-variable ((this ede-compiler)
+(cl-defmethod ede-compiler-intermediate-object-variable ((this ede-compiler)
                                                      targetname)
   "Return a string based on THIS representing a make object variable.
 TARGETNAME is the name of the target that these objects belong to."
   (concat targetname "_OBJ"))
 
-(defmethod ede-proj-makefile-insert-object-variables ((this ede-compiler)
+(cl-defmethod ede-proj-makefile-insert-object-variables ((this ede-compiler)
                                                      targetname sourcefiles)
   "Insert an OBJ variable to specify object code to be generated for THIS.
 The name of the target is TARGETNAME as a string.  SOURCEFILES is the list of
@@ -312,34 +312,35 @@ Not all compilers do this."
                sourcefiles)
          (insert "\n")))))
 
-(defmethod ede-proj-makefile-insert-rules ((this ede-compilation-program))
+(cl-defmethod ede-proj-makefile-insert-rules ((this ede-compilation-program))
   "Insert rules needed for THIS compiler object."
   (ede-compiler-only-once this
     (mapc 'ede-proj-makefile-insert-rules (oref this rules))))
 
-(defmethod ede-proj-makefile-insert-rules ((this ede-makefile-rule))
+(cl-defmethod ede-proj-makefile-insert-rules ((this ede-makefile-rule))
   "Insert rules needed for THIS rule object."
-  (if (oref this phony) (insert ".PHONY: (oref this target)\n"))
+  (if (oref this phony) (insert ".PHONY: " (oref this target) "\n"))
   (insert (oref this target) ": " (oref this dependencies) "\n\t"
          (mapconcat (lambda (c) c) (oref this rules) "\n\t")
          "\n\n"))
 
-(defmethod ede-proj-makefile-insert-commands ((this ede-compilation-program))
+(cl-defmethod ede-proj-makefile-insert-commands ((this ede-compilation-program))
   "Insert the commands needed to use compiler THIS.
 The object creating makefile rules must call this method for the
 compiler it decides to use after inserting in the rule."
   (when (slot-boundp this 'commands)
     (with-slots (commands) this
       (mapc
-       (lambda (obj) (insert "\t"
-                            (cond ((stringp obj)
-                                   obj)
-                                  ((and (listp obj)
-                                        (eq (car obj) 'lambda))
-                                   (funcall obj))
-                                  (t
-                                   (format "%S" obj)))
-                            "\n"))
+       (lambda (obj) (insert
+                     (if (bolp) "\t" " ")
+                     (cond ((stringp obj)
+                            obj)
+                           ((and (listp obj)
+                                 (eq (car obj) 'lambda))
+                            (funcall obj))
+                           (t
+                            (format "%S" obj)))
+                     "\n"))
        commands))
     (insert "\n")))