;;; ede/linux.el --- Special project for Linux
-;; Copyright (C) 2008-2014 Free Software Foundation, Inc.
+;; Copyright (C) 2008-2016 Free Software Foundation, Inc.
;; Author: Eric M. Ludlam <eric@siege-engine.com>
(defcustom project-linux-compile-target-command (concat ede-make-command " -k -C %s SUBDIRS=%s")
- "*Default command used to compile a target."
+ "Default command used to compile a target."
:group 'project-linux
:type 'string)
(defcustom project-linux-compile-project-command (concat ede-make-command " -k -C %s")
- "*Default command used to compile a project."
+ "Default command used to compile a project."
:group 'project-linux
:type 'string)
(cons bdir "include/generated/uapi"))))
;;;###autoload
-(defun ede-linux-load (dir &optional rootproj)
+(defun ede-linux-load (dir &optional _rootproj)
"Return an Linux Project object if there is a match.
Return nil if there isn't one.
Argument DIR is the directory it is created for.
(let* ((bdir (ede-linux--get-build-directory dir))
(arch (ede-linux--get-architecture dir bdir))
(include-path (ede-linux--include-path dir bdir arch)))
- (ede-linux-project
- "Linux"
+ (make-instance 'ede-linux-project
:name "Linux"
:version (ede-linux-version dir)
:directory (file-name-as-directory dir)
;;;###autoload
(ede-add-project-autoload
- (ede-project-autoload "linux"
- :name "LINUX ROOT"
- :file 'ede/linux
- :proj-file "scripts/ver_linux"
- :load-type 'ede-linux-load
- :class-sym 'ede-linux-project
- :new-p nil
- :safe-p t)
+ (make-instance 'ede-project-autoload
+ :name "LINUX ROOT"
+ :file 'ede/linux
+ :proj-file "scripts/ver_linux"
+ :load-type 'ede-linux-load
+ :class-sym 'ede-linux-project
+ :new-p nil
+ :safe-p t)
'unique)
(defclass ede-linux-target-c (ede-target)
"EDE Linux Project target for Misc files.
All directories need at least one target.")
-(defmethod initialize-instance ((this ede-linux-project)
- &rest fields)
+(cl-defmethod initialize-instance ((this ede-linux-project)
+ &rest _fields)
"Make sure the targets slot is bound."
- (call-next-method)
+ (cl-call-next-method)
(unless (slot-boundp this 'targets)
(oset this :targets nil)))
;;; File Stuff
;;
-(defmethod ede-project-root-directory ((this ede-linux-project)
- &optional file)
+(cl-defmethod ede-project-root-directory ((this ede-linux-project)
+ &optional _file)
"Return the root for THIS Linux project with file."
(ede-up-directory (file-name-directory (oref this file))))
-(defmethod ede-project-root ((this ede-linux-project))
+(cl-defmethod ede-project-root ((this ede-linux-project))
"Return my root."
this)
-(defmethod ede-find-subproject-for-directory ((proj ede-linux-project)
- dir)
+(cl-defmethod ede-find-subproject-for-directory ((proj ede-linux-project)
+ _dir)
"Return PROJ, for handling all subdirs below DIR."
proj)
(let ((match nil))
(dolist (T targets)
(when (and (object-of-class-p T class)
- (string= (oref T :path) dir))
+ (string= (oref T path) dir))
(setq match T)
))
match))
-(defmethod ede-find-target ((proj ede-linux-project) buffer)
+(cl-defmethod ede-find-target ((proj ede-linux-project) buffer)
"Find an EDE target in PROJ for BUFFER.
If one doesn't exist, create a new one for this directory."
(let* ((ext (file-name-extension (buffer-file-name buffer)))
;;; UTILITIES SUPPORT.
;;
-(defmethod ede-preprocessor-map ((this ede-linux-target-c))
+(cl-defmethod ede-preprocessor-map ((this ede-linux-target-c))
"Get the pre-processor map for Linux C code.
All files need the macros from lisp.h!"
(require 'semantic/db)
(let ((F (expand-file-name name (expand-file-name subdir root))))
(when (file-exists-p F) F)))
-(defmethod ede-expand-filename-impl ((proj ede-linux-project) name)
+(cl-defmethod ede-expand-filename-impl ((proj ede-linux-project) name)
"Within this project PROJ, find the file NAME.
Knows about how the Linux source tree is organized."
(let* ((ext (file-name-extension name))
((string-match "txt" ext)
(ede-linux-file-exists-name name dir "Documentation"))
(t nil))))
- (or F (call-next-method))))
+ (or F (cl-call-next-method))))
;;; Command Support
;;
-(defmethod project-compile-project ((proj ede-linux-project)
+(cl-defmethod project-compile-project ((proj ede-linux-project)
&optional command)
"Compile the entire current project.
Argument COMMAND is the command to use when compiling."
(compile command)))
-(defmethod project-compile-target ((obj ede-linux-target-c) &optional command)
+(cl-defmethod project-compile-target ((obj ede-linux-target-c) &optional command)
"Compile the current target.
Argument COMMAND is the command to use for compiling the target."
(let* ((proj (ede-target-parent obj))
(compile command)))
-(defmethod project-rescan ((this ede-linux-project))
+(cl-defmethod project-rescan ((this ede-linux-project))
"Rescan this Linux project from the sources."
(let* ((dir (ede-project-root-directory this))
(bdir (ede-linux--get-build-directory dir))